diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-02-24 22:10:37 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-02-24 22:10:37 -0800 |
commit | 117c1b333da05e87a35ea73756518abe52407d84 (patch) | |
tree | 8c7dc4c0fbe9b7d26f2955ee3b95c626f3e1f6cb | |
parent | 9f8410b941130630db288794c253e697e4515d9d (diff) | |
parent | 8b9c2dd4dee01b5a0a9c5cfdd5a107f78edaceb7 (diff) | |
download | git-117c1b333da05e87a35ea73756518abe52407d84.tar.gz git-117c1b333da05e87a35ea73756518abe52407d84.tar.xz |
Merge branch 'jk/dumb-http-idx-fetch-fix' into maint
A broken pack .idx file in the receiving repository prevented the
dumb http transport from fetching a good copy of it from the other
side.
* jk/dumb-http-idx-fetch-fix:
dumb-http: do not pass NULL path to parse_pack_index
-rw-r--r-- | http.c | 2 | ||||
-rwxr-xr-x | t/t5550-http-fetch-dumb.sh | 18 |
2 files changed, 19 insertions, 1 deletions
@@ -1250,7 +1250,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head, int ret; if (has_pack_index(sha1)) { - new_pack = parse_pack_index(sha1, NULL); + new_pack = parse_pack_index(sha1, sha1_pack_index_name(sha1)); if (!new_pack) return -1; /* parse_pack_index() already issued error message */ goto add_pack; diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index ac71418a1..6da942243 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -165,6 +165,24 @@ test_expect_success 'fetch notices corrupt idx' ' ) ' +test_expect_success 'fetch can handle previously-fetched .idx files' ' + git checkout --orphan branch1 && + echo base >file && + git add file && + git commit -m base && + git --bare init "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git && + git push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch1 && + git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d && + git checkout -b branch2 branch1 && + echo b2 >>file && + git commit -a -m b2 && + git push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch2 && + git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d && + git --bare init clone_packed_branches.git && + git --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch1:branch1 && + git --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch2:branch2 +' + test_expect_success 'did not use upload-pack service' ' grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act : >exp |