Test whether regular and full hideRefs patterns work as expected when namespaces are used. Signed-off-by: Lukas Fleischer <lfleischer@xxxxxxx> --- t/t5509-fetch-push-namespaces.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh index cc0b31f..a3f1060 100755 --- a/t/t5509-fetch-push-namespaces.sh +++ b/t/t5509-fetch-push-namespaces.sh @@ -82,4 +82,33 @@ test_expect_success 'mirroring a repository using a ref namespace' ' ) ' +test_expect_success "Hide namespaced refs with transfer.hideRefs" ' + cd pushee && + test_config transfer.hideRefs refs/tags && + GIT_NAMESPACE=namespace git ls-remote "ext::git %s ." >actual && + printf "$commit1\trefs/heads/master\n" >expected && + test_cmp expected actual && + cd .. +' + +test_expect_success "Check that transfer.hideRefs does not match unstripped refs" ' + cd pushee && + test_config transfer.hideRefs "refs/namespaces/namespace/refs/tags" && + GIT_NAMESPACE=namespace git ls-remote "ext::git %s ." >actual && + printf "$commit1\trefs/heads/master\n" >expected && + printf "$commit0\trefs/tags/0\n" >>expected && + printf "$commit1\trefs/tags/1\n" >>expected && + test_cmp expected actual && + cd .. +' + +test_expect_success "Hide full refs with transfer.hideRefs" ' + cd pushee && + test_config transfer.hideRefs "^refs/namespaces/namespace/refs/tags" && + GIT_NAMESPACE=namespace git ls-remote "ext::git %s ." >actual && + printf "$commit1\trefs/heads/master\n" >expected && + test_cmp expected actual && + cd .. +' + test_done -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html