Merge branch 'jk/long-error-messages'
[gitweb.git] / t / t5512-ls-remote.sh
index 3bd9759e0ff01af9969e1f8ae088945d9e2e34e4..aadaac515e086a7f87c6d06a0313fe7b77d11f92 100755 (executable)
@@ -128,6 +128,11 @@ test_expect_success 'Report match with --exit-code' '
        test_cmp expect actual
 '
 
+test_expect_success 'set up some extra tags for ref hiding' '
+       git tag magic/one &&
+       git tag magic/two
+'
+
 for configsection in transfer uploadpack
 do
        test_expect_success "Hide some refs with $configsection.hiderefs" '
@@ -138,6 +143,24 @@ do
                sed -e "/       refs\/tags\//d" >expect &&
                test_cmp expect actual
        '
+
+       test_expect_success "Override hiding of $configsection.hiderefs" '
+               test_when_finished "test_unconfig $configsection.hiderefs" &&
+               git config --add $configsection.hiderefs refs/tags &&
+               git config --add $configsection.hiderefs "!refs/tags/magic" &&
+               git config --add $configsection.hiderefs refs/tags/magic/one &&
+               git ls-remote . >actual &&
+               grep refs/tags/magic/two actual &&
+               ! grep refs/tags/magic/one actual
+       '
+
 done
 
+test_expect_success 'overrides work between mixed transfer/upload-pack hideRefs' '
+       test_config uploadpack.hiderefs refs/tags &&
+       test_config transfer.hiderefs "!refs/tags/magic" &&
+       git ls-remote . >actual &&
+       grep refs/tags/magic actual
+'
+
 test_done