summaryrefslogtreecommitdiff
path: root/git-fat
diff options
context:
space:
mode:
Diffstat (limited to 'git-fat')
-rwxr-xr-xgit-fat16
1 files changed, 7 insertions, 9 deletions
diff --git a/git-fat b/git-fat
index bdacd4e..c1f8ed6 100755
--- a/git-fat
+++ b/git-fat
@@ -144,15 +144,13 @@ class GitFat(object):
with os.fdopen(fd, 'w') as cache:
outstream = cache
blockiter = readblocks(sys.stdin)
- # Check whether this file is hanging
- block = next(blockiter)
- if self.decode_clean(block[0:self.magiclen]):
- ishanging = True
- outstream = sys.stdout
- h.update(block)
- bytes += len(block)
- outstream.write(block)
- for block in blockiter:
+ firstblock = True
+ for block in readblocks(sys.stdin):
+ if firstblock:
+ if len(block) == self.magiclen and self.decode_clean(block[0:self.magiclen]):
+ ishanging = True # Working tree version is verbatim from repository (not smudged)
+ outstream = sys.stdout
+ firstblock = False
h.update(block)
bytes += len(block)
outstream.write(block)