]> arthur.barton.de Git - bup.git/commitdiff
client: fix a race condition when the server suggests an index.
authorAvery Pennarun <apenwarr@gmail.com>
Sat, 30 Jan 2010 21:09:38 +0000 (16:09 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Sat, 30 Jan 2010 21:09:38 +0000 (16:09 -0500)
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.

client.py

index 7b24a4345ce9d75172dea810450258b948b44b32..9233520033c93859a1ac2864080229cc3bb57087 100644 (file)
--- 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: