瀏覽代碼

Merge branch 'http-fetch-capa' of git://github.com/wgrant/dulwich

Conflicts:
	NEWS
Jelmer Vernooij 11 年之前
父節點
當前提交
bf350f9b71
共有 3 個文件被更改,包括 6 次插入2 次删除
  1. 3 0
      NEWS
  2. 1 1
      dulwich/client.py
  3. 2 1
      dulwich/tests/compat/utils.py

+ 3 - 0
NEWS

@@ -9,6 +9,9 @@
   * Several fixes in send-pack protocol behaviour - handling of empty pack files and deletes.
     (milki, #1063087)
 
+  * Fix capability negotiation when fetching packs over HTTP.
+    (#1072461, William Grant)
+
  IMPROVEMENTS
 
   * Support passing a single revision to BaseRepo.get_walker() rather than a list of revisions. 

+ 1 - 1
dulwich/client.py

@@ -811,7 +811,7 @@ class HttpGitClient(GitClient):
         url = self._get_url(path)
         refs, server_capabilities = self._discover_references(
             "git-upload-pack", url)
-        negotiated_capabilities = server_capabilities
+        negotiated_capabilities = self._fetch_capabilities & server_capabilities
         wants = determine_wants(refs)
         if wants is not None:
             wants = [cid for cid in wants if cid != ZERO_SHA]

+ 2 - 1
dulwich/tests/compat/utils.py

@@ -134,7 +134,8 @@ def run_git(args, git_path=_DEFAULT_GIT, input=None, capture_stdout=False,
 
 def run_git_or_fail(args, git_path=_DEFAULT_GIT, input=None, **popen_kwargs):
     """Run a git command, capture stdout/stderr, and fail if git fails."""
-    popen_kwargs['stderr'] = subprocess.STDOUT
+    if 'stderr' not in popen_kwargs:
+        popen_kwargs['stderr'] = subprocess.STDOUT
     returncode, stdout = run_git(args, git_path=git_path, input=input,
                                  capture_stdout=True, **popen_kwargs)
     if returncode != 0: