Преглед на файлове

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 години
родител
ревизия
4974d15710
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  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(