summaryrefslogtreecommitdiff
path: root/git-fat
diff options
context:
space:
mode:
authorJed Brown <jed@59A2.org>2012-11-26 11:48:18 +0100
committerJed Brown <jed@59A2.org>2012-11-26 11:48:18 +0100
commit8929613ecf4172a575839a78acc481cadeacd5c0 (patch)
tree2ed3113c6397020e8a00d68a56892545934e7541 /git-fat
parentf64ccb7c0cc2be010e5b2e5014c08df790421388 (diff)
downloadgit-fat-8929613ecf4172a575839a78acc481cadeacd5c0.tar.gz
Comment explaining how 'git fat checkout' forces resmudging
Diffstat (limited to 'git-fat')
-rwxr-xr-xgit-fat7
1 files changed, 7 insertions, 0 deletions
diff --git a/git-fat b/git-fat
index b2ec8d7..e963a7e 100755
--- a/git-fat
+++ b/git-fat
@@ -205,7 +205,14 @@ class GitFat(object):
objpath = os.path.join(self.objdir, digest)
if os.access(objpath, os.R_OK):
print('Restoring %s -> %s' % (digest, fname))
+ # The output of our smudge filter depends on the existence of
+ # the file in .git/fat/objects, but git caches the file stat
+ # from the previous time the file was smudged, therefore it
+ # won't try to re-smudge. I don't know a git command that
+ # specifically invalidates that cache, but touching the file
+ # also does the trick.
os.utime(fname, None)
+ # This re-smudge is essentially a copy that restores permissions.
subprocess.check_call(['git', 'checkout-index', '--index', '--force', fname])
elif show_orphans:
print('Data unavailable: %s %s' % (digest,fname))