Forráskód Böngészése

Allow "ACK" and "NACK" (without new line) in client.py

While working in my own environment the archive was failing for me
with "invalid response ACK" message. Looks like my git (hosted gerrit)
returns ACK instead of "ACK\n" expected by that code. As the shell
git clients works well with my server, seems like both versions should be
supported by the library.
DzmitrySudnik 4 éve
szülő
commit
4974d15710
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      dulwich/client.py

+ 2 - 2
dulwich/client.py

@@ -969,9 +969,9 @@ class TraditionalGitClient(GitClient):
                 pkt = proto.read_pkt_line()
             except HangupException:
                 raise _remote_error_from_stderr(stderr)
-            if pkt == b"NACK\n":
+            if pkt == b"NACK\n" or pkt == b"NACK":
                 return
-            elif pkt == b"ACK\n":
+            elif pkt == b"ACK\n" or pkt == b"ACK":
                 pass
             elif pkt.startswith(b"ERR "):
                 raise GitProtocolError(