Skip to content

Commit b83a744

Browse files
committed
ingore decompress error
1 parent 9119d57 commit b83a744

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

GitHack.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def __init__(self):
4040
for entry in parse('index'):
4141
if "sha1" in entry.keys():
4242
self.queue.put((entry["sha1"].strip(), entry["name"].strip()))
43-
print entry['name']
43+
try:
44+
print entry['name']
45+
except:
46+
pass
4447
self.lock = threading.Lock()
4548
self.thread_count = 20
4649
self.STOP_ME = False
@@ -64,7 +67,10 @@ def get_back_file(self):
6467
try:
6568
folder = '/objects/%s/' % sha1[:2]
6669
data = self._request_data(self.base_url + folder + sha1[2:])
67-
data = zlib.decompress(data)
70+
try:
71+
data = zlib.decompress(data)
72+
except:
73+
self._print('[Error] Fail to decompress %s' % file_name)
6874
data = re.sub('blob \d+\00', '', data)
6975
target_dir = os.path.join(self.domain, os.path.dirname(file_name) )
7076
if target_dir and not os.path.exists(target_dir):

0 commit comments

Comments
 (0)