]> arthur.barton.de Git - bup.git/commitdiff
CatPipe.get: report unexpected cat-file exit status
authorRob Browning <rlb@defaultvalue.org>
Sun, 3 Oct 2021 19:57:55 +0000 (14:57 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 10 Oct 2021 17:01:28 +0000 (12:01 -0500)
Thanks to Mark Hewitt for reporting a problem that suggested we should
handle this case more carefully.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py

index ce8041a7be7e8cfaf26ced58edd0df7f5689847b..dbfe78f6e81d48b7e8a21bdad7b682899ea91b01 100644 (file)
@@ -1299,6 +1299,9 @@ class CatPipe:
         self.p.stdin.write(ref + b'\n')
         self.p.stdin.flush()
         hdr = self.p.stdout.readline()
+        if not hdr:
+            raise GitError('unexpected cat-file EOF (last request: %r, exit: %s)'
+                           % (ref, self.p.poll() or 'none'))
         if hdr.endswith(b' missing\n'):
             self.inprogress = None
             yield None, None, None