diff options
author | Christian Hitz <christian.hitz@aizo.com> | 2013-08-29 10:03:56 +0200 |
---|---|---|
committer | Christian Hitz <christian.hitz@aizo.com> | 2013-08-29 10:03:56 +0200 |
commit | 776cc7cf682959c684cd2f0ee0c9044bee3dac76 (patch) | |
tree | dc59dc48f2175b986f5aeaa601619958c8f8aaef /git-fat | |
parent | f0becae702b967e1b963b1a101aca233436272e8 (diff) | |
download | git-fat-776cc7cf682959c684cd2f0ee0c9044bee3dac76.tar.gz |
fix handling of broken symlinks
if a symlink has a length of self.magiclen git-fat would crash
because it could not read the file
Diffstat (limited to 'git-fat')
-rwxr-xr-x | git-fat | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -194,7 +194,10 @@ class GitFat(object): if stat.st_size != self.magiclen: return False, None # read file - digest, bytes = self.decode_stream(open(fname)) + try: + digest, bytes = self.decode_stream(open(fname)) + except IOError: + return False, None if isinstance(digest, str): return digest, bytes else: |