diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:15 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:15 -0700 |
commit | 86d87307c1c490282749e278380b9a258de0b46c (patch) | |
tree | eeac81ad5d3611520950f7ac59229c2033e23fcb /t | |
parent | Merge branch 'ew/server-info-remove-crufts' (diff) | |
parent | upload-pack: strip namespace from symref data (diff) | |
download | tgif-86d87307c1c490282749e278380b9a258de0b46c.tar.xz |
Merge branch 'jk/HEAD-symref-in-xfer-namespaces'
The server side support for "git fetch" used to show incorrect
value for the HEAD symbolic ref when the namespace feature is in
use, which has been corrected.
* jk/HEAD-symref-in-xfer-namespaces:
upload-pack: strip namespace from symref data
Diffstat (limited to 't')
-rwxr-xr-x | t/t5509-fetch-push-namespaces.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh index c88df78c0b..75cbfcc392 100755 --- a/t/t5509-fetch-push-namespaces.sh +++ b/t/t5509-fetch-push-namespaces.sh @@ -124,4 +124,32 @@ test_expect_success 'try to update a hidden full ref' ' test_must_fail git -C original push pushee-namespaced master ' +test_expect_success 'set up ambiguous HEAD' ' + git init ambiguous && + ( + cd ambiguous && + git commit --allow-empty -m foo && + git update-ref refs/namespaces/ns/refs/heads/one HEAD && + git update-ref refs/namespaces/ns/refs/heads/two HEAD && + git symbolic-ref refs/namespaces/ns/HEAD \ + refs/namespaces/ns/refs/heads/two + ) +' + +test_expect_success 'clone chooses correct HEAD (v0)' ' + GIT_NAMESPACE=ns git -c protocol.version=0 \ + clone ambiguous ambiguous-v0 && + echo refs/heads/two >expect && + git -C ambiguous-v0 symbolic-ref HEAD >actual && + test_cmp expect actual +' + +test_expect_success 'clone chooses correct HEAD (v2)' ' + GIT_NAMESPACE=ns git -c protocol.version=2 \ + clone ambiguous ambiguous-v2 && + echo refs/heads/two >expect && + git -C ambiguous-v2 symbolic-ref HEAD >actual && + test_cmp expect actual +' + test_done |