Merge pack protocol receiver fix.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 11 Apr 2010 01:01:04 +0000 (03:01 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 11 Apr 2010 01:01:04 +0000 (03:01 +0200)
1  2 
dulwich/client.py

index a91d7994bef173edad339e3834f2ac62353b3868,579c708cfc2caf3202ce061fbce075ba9b825952..de4254d19454373d7b0c1a94171926e24790ebe7
@@@ -119,10 -120,15 +120,16 @@@ class GitClient(object)
                                           len(objects))
          
          # read the final confirmation sha
-         client_sha = self.proto.read(20)
-         if not client_sha in (None, "", sha):
-             raise ChecksumMismatch(sha, client_sha)
-             
+         try:
+             client_sha = self.proto.read_pkt_line()
 -            if not client_sha in (None, "", sha):
 -                raise ChecksumMismatch(sha, client_sha)
+         except HangupException:
+             # for git-daemon versions before v1.6.6.1-26-g38a81b4, there is
+             # nothing to read; catch this and hide from the user.
+             pass
++        else:
++            if not client_sha in (None, "", sha):
++                raise ChecksumMismatch(sha, client_sha)
          return new_refs
  
      def fetch(self, path, target, determine_wants=None, progress=None):