From: Avery Pennarun Date: Sat, 30 Jan 2010 21:09:38 +0000 (-0500) Subject: client: fix a race condition when the server suggests an index. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d9e823e7672156d8cdd971290db8370babdb7bd5;p=packages%2Fb%2Fbup.git client: fix a race condition when the server suggests an index. 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. --- diff --git a/client.py b/client.py index 7b24a43..9233520 100644 --- a/client.py +++ b/client.py @@ -210,7 +210,13 @@ class PackWriter_Remote(git.PackWriter): 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: