diff options
author | Brandon Williams <bmwill@google.com> | 2018-05-16 23:48:22 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-17 21:35:37 (GMT) |
commit | dcc73cf7ffd17e68bda05fff4c139465580aff28 (patch) | |
tree | ee4686099c014f6b78cc5fea93980e52020fd9c6 /t/t5702-protocol-v2.sh | |
parent | 6373cb598e1a4e0340583ad75d5abba01ff79774 (diff) | |
download | git-dcc73cf7ffd17e68bda05fff4c139465580aff28.zip git-dcc73cf7ffd17e68bda05fff4c139465580aff28.tar.gz git-dcc73cf7ffd17e68bda05fff4c139465580aff28.tar.bz2 |
fetch: generate ref-prefixes when using a configured refspec
Teach fetch to generate ref-prefixes, to be used for server-side
filtering of the ref-advertisement, based on the configured fetch
refspec ('remote.<name>.fetch') when no user provided refspec exists.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5702-protocol-v2.sh')
-rwxr-xr-x | t/t5702-protocol-v2.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 56f7c3c..b6c72ab 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -201,6 +201,20 @@ test_expect_success 'ref advertisment is filtered during fetch using protocol v2 ! grep "refs/tags/three" log ' +test_expect_success 'default refspec is used to filter ref when fetchcing' ' + test_when_finished "rm -f log" && + + GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \ + fetch origin && + + git -C file_child log -1 --format=%s three >actual && + git -C file_parent log -1 --format=%s three >expect && + test_cmp expect actual && + + grep "ref-prefix refs/heads/" log && + grep "ref-prefix refs/tags/" log +' + # Test protocol v2 with 'http://' transport # . "$TEST_DIRECTORY"/lib-httpd.sh |