From 9913d4d584c380d0b72711ff5de8f19d3408e207 Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Mon, 28 Jan 2013 10:24:12 -0600 Subject: Repair pipe handling in 6f1f0d65ba38, handle missing case, and de-duplicate --- git-fat | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'git-fat') 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' -- cgit v1.2.1