Skip to content

Commit

Permalink
client: fix a race condition when the server suggests an index.
Browse files Browse the repository at this point in the history
If we finished our current pack too quickly after getting the suggestion,
the client would get confused, resulting in 'exected "ok, got %r' type
errors.
  • Loading branch information
apenwarr committed Jan 30, 2010
1 parent 0d205c0 commit d9e823e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,13 @@ def _end(self):
if self._packopen and self.file:
self.file.write('\0\0\0\0')
self._packopen = False
id = self.file.readline().strip()
while True:
line = self.file.readline().strip()
if line.startswith('index '):
pass
else:
break
id = line
self.file.check_ok()
self.objcache = None
if self.onclose:
Expand Down

0 comments on commit d9e823e

Please sign in to comment.