Merge branch 'jk/fetch-reachability-error-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Apr 2019 07:41:23 +0000 (16:41 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Apr 2019 07:41:23 +0000 (16:41 +0900)
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

1  2 
fetch-pack.c
t/t5516-fetch-push.sh
diff --cc fetch-pack.c
Simple merge
index 49bf4280e85cae7da71b54192ab83879931283bd,4f065212b85c437d1669767bca50795490f8a2c7..c81ca360ac4ac9edccf86132aa63e44812906980
                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