浏览代码

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(