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
Next Next commit
Fixed fast decode operation in repos that use sparse-checkout
  • Loading branch information
ozkandikmen-work committed Jun 2, 2014
commit 8a73e024a96692d03a972985f210e9e89aabd35a
11 changes: 8 additions & 3 deletions git-fat
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,16 @@ class GitFat(object):
# Not sure if this is the right behavior
return itertools.chain([preamble], readblocks(stream)), None
def decode_file(self, fname):
# Fast check
import errno
# Fast check - In case sparse-checkout is used, do not choke on missing files
try:
stat = os.lstat(fname)
except OSError:
return False, None
except OSError as exc:
if exc.errno == errno.ENOENT:
pass
return False, None
else:
raise
if stat.st_size not in self.magiclens:
return False, None
# read file
Expand Down