Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
git fat checkout, git fat pull: use null-terminated filename strings …
…when talking to git.
  • Loading branch information
purdeaandrei committed Jul 13, 2015
commit 3641e8a2664c2964cb90e01ca30ee67efae67e1a
6 changes: 3 additions & 3 deletions git-fat
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class GitFat(object):
if not accessible:
print('Data unavailable: %s %s' % (digest,fname))

filenames_str = "\n".join(filenames_to_restore) + "\n"
filenames_nullterm = "\x00".join(filenames_to_restore)

if not self.is_verbose:
print('Restoring %d Files' % (len(filenames_to_restore),))
Expand All @@ -433,9 +433,9 @@ class GitFat(object):

if filenames_to_restore:
# This re-smudge is essentially a copy that restores permissions.
cmd = ['git', 'checkout-index', '--stdin', '--index', '--force']
cmd = ['git', 'checkout-index', '--stdin', '-z', '--index', '--force']
p = subprocess.Popen(cmd, stdin = subprocess.PIPE)
p.communicate(filenames_str)
p.communicate(filenames_nullterm)
retcode = p.wait()
if retcode != 0:
error = subprocess.CalledProcessError(retcode, " ".join(cmd))
Expand Down