소스 검색

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(