From: Junio C Hamano Date: Thu, 25 Apr 2019 07:41:23 +0000 (+0900) Subject: Merge branch 'jk/fetch-reachability-error-fix' X-Git-Tag: v2.22.0-rc0~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57a6b93236f3b1667a1947d3fc83f6e942d3bfca;p=thirdparty%2Fgit.git Merge branch 'jk/fetch-reachability-error-fix' Code clean-up and a fix for "git fetch" by an explicit object name (as opposed to fetching refs by name). * jk/fetch-reachability-error-fix: fetch: do not consider peeled tags as advertised tips remote.c: make singular free_ref() public fetch: use free_refs() pkt-line: prepare buffer before handling ERR packets upload-pack: send ERR packet for non-tip objects t5530: check protocol response for "not our ref" t5516: drop ok=sigpipe from unreachable-want tests --- 57a6b93236f3b1667a1947d3fc83f6e942d3bfca diff --cc t/t5516-fetch-push.sh index 49bf4280e8,4f065212b8..c81ca360ac --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@@ -1239,20 -1232,16 +1239,21 @@@ d mk_empty shallow && ( cd shallow && - test_must_fail git fetch ../testrepo/.git $SHA1_3 && - test_must_fail git fetch ../testrepo/.git $SHA1_1 && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. - test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ ++ test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git fetch ../testrepo/.git $SHA1_3 && - test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ ++ test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git fetch ../testrepo/.git $SHA1_1 && git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true && git fetch ../testrepo/.git $SHA1_1 && git cat-file commit $SHA1_1 && test_must_fail git cat-file commit $SHA1_2 && git fetch ../testrepo/.git $SHA1_2 && git cat-file commit $SHA1_2 && - test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ - git fetch ../testrepo/.git $SHA1_3 - test_must_fail git fetch ../testrepo/.git $SHA1_3 2>err && ++ test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ ++ git fetch ../testrepo/.git $SHA1_3 2>err && + test_i18ngrep "remote error:.*not our ref.*$SHA1_3\$" err ) ' done