Skip to content

Commit

Permalink
Fix broken rsync pull, bug introduced in 309f630
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Feb 18, 2013
1 parent 0f143e2 commit 6208687
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 6 additions & 1 deletion git-fat
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ class GitFat(object):
rshopts += ' -p ' + ssh_port
if rshopts:
cmd.append('--rsh=ssh' + rshopts)
cmd += [self.objdir + '/', remote + '/']
if push:
cmd += [self.objdir + '/', remote + '/']
else:
cmd += [remote + '/', self.objdir + '/']
return cmd
def revparse(self, revname):
return subprocess.check_output(['git', 'rev-parse', revname]).strip()
Expand Down Expand Up @@ -295,6 +298,7 @@ class GitFat(object):
pushall = '--all' in args
files = self.referenced_objects(all=pushall) & self.catalog_objects()
cmd = self.get_rsync_command(push=True)
self.verbose('Executing: %s' % ' '.join(cmd))
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
p.communicate(input='\x00'.join(files))
def checkout(self, show_orphans=False):
Expand Down Expand Up @@ -328,6 +332,7 @@ class GitFat(object):
refargs['rev'] = rev
files = self.referenced_objects(**refargs) - self.catalog_objects()
cmd = self.get_rsync_command(push=False)
self.verbose('Executing: %s' % ' '.join(cmd))
p = subprocess.Popen(cmd, stdin=subprocess.PIPE)
p.communicate(input='\x00'.join(files))
self.checkout()
Expand Down
16 changes: 16 additions & 0 deletions test-retroactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,19 @@ git checkout HEAD^
rm *
git checkout .
ls -al

# Set up place to push
git checkout master
cat > .gitfat <<EOF
[rsync]
remote = $(realpath ../retro-store)
EOF
git add .gitfat
git commit -m'Add .gitfat for local push'
git fat push

cd ..
git clone file:///$(realpath retro) retro-clone
cd retro-clone
git fat init
git fat pull

0 comments on commit 6208687

Please sign in to comment.