summaryrefslogtreecommitdiff
path: root/git-fat
diff options
context:
space:
mode:
authorJed Brown <jed@59A2.org>2013-01-28 10:24:12 -0600
committerJed Brown <jed@59A2.org>2013-01-28 10:24:12 -0600
commit9913d4d584c380d0b72711ff5de8f19d3408e207 (patch)
treefa6e8bb45cf805310ba812889c040c0e00b574aa /git-fat
parent6f1f0d65ba3899805c5d8124633b6d2c088fc2fb (diff)
downloadgit-fat-9913d4d584c380d0b72711ff5de8f19d3408e207.tar.gz
Repair pipe handling in 6f1f0d65ba38, handle missing case, and de-duplicate
Diffstat (limited to 'git-fat')
-rwxr-xr-xgit-fat20
1 files changed, 10 insertions, 10 deletions
diff --git a/git-fat b/git-fat
index 17b2de4..9b25507 100755
--- a/git-fat
+++ b/git-fat
@@ -280,16 +280,16 @@ class GitFat(object):
(remote, ssh_port, ssh_user) = self.get_rsync()
self.verbose('Pushing to %s' % (remote))
- if ssh_port == None and ssh_user == None:
- cmd = ['rsync', '--progress', '--ignore-existing', '--from0', '--files-from=-', self.objdir + '/', remote + '/']
- else:
- if ssh_user == None:
- cmd = ['rsync', '--progress', '--ignore-existing', '--from0', '--files-from=-', self.objdir + '/', '--rsh=ssh -p' + ssh_port, remote + '/']
- else:
- cmd = ['rsync', '--progress', '--ignore-existing', '--from0', '--files-from=-', self.objdir + '/', '--rsh=ssh -l ' + ssh_user + '-p ' + ssh_port, remote + '/']
-
- print( cmd )
- p = subprocess.Popen(cmd, subprocess.PIPE)
+ cmd = ['rsync', '--progress', '--ignore-existing', '--from0', '--files-from=-']
+ rshopts = ''
+ if ssh_user:
+ rshopts += ' -l ' + ssh_user
+ if ssh_port:
+ rshopts += ' -p ' + ssh_port
+ if rshopts:
+ cmd.append('--rsh=ssh' + rshopts)
+ cmd += [self.objdir + '/', remote + '/']
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
p.communicate(input='\x00'.join(files))
def checkout(self, show_orphans=False):
'Update any stale files in the present working tree'