summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRafael Ascensão <rafa.almas@gmail.com>2018-11-12 13:25:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-13 05:41:22 (GMT)
commit9ab9b5df0ee2a49e0c1354a667e1e00db903f516 (patch)
tree12d807f4027241a66ecd1eba1bfb5b18affeb005 /t
parent9d55dca262e8657b87dbd4c5b3494e1ecb7a0dbd (diff)
downloadgit-9ab9b5df0ee2a49e0c1354a667e1e00db903f516.zip
git-9ab9b5df0ee2a49e0c1354a667e1e00db903f516.tar.gz
git-9ab9b5df0ee2a49e0c1354a667e1e00db903f516.tar.bz2
refs: fix some exclude patterns being ignored
`--exclude` from rev-list and rev-parse fails to exclude references if the next `--branches`, `--tags` or `--remotes` use the optional inclusive glob because those options are implemented as particular cases of `--glob=`, which itself requires that exclude patterns begin with 'refs/'. But it makes sense for `--branches=glob` and friends to be aware that exclusions patterns for them shouldn't be 'refs/<type>/' prefixed, the same way exclude patterns for `--branches` and friends (without the optional glob) already are. Let's record in 'refs.c:struct ref_filter' which context the exclude pattern is tied to, so refs.c:filter_refs() can decide if it should ignore the prefix when trying to match. Signed-off-by: Rafael Ascensão <rafa.almas@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6018-rev-list-glob.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/t/t6018-rev-list-glob.sh b/t/t6018-rev-list-glob.sh
index 8e2b136..7dc6cbd 100755
--- a/t/t6018-rev-list-glob.sh
+++ b/t/t6018-rev-list-glob.sh
@@ -147,51 +147,51 @@ test_expect_success 'rev-parse accumulates multiple --exclude' '
compare rev-parse "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
'
-test_expect_failure 'rev-parse --exclude=glob with --branches=glob' '
+test_expect_success 'rev-parse --exclude=glob with --branches=glob' '
compare rev-parse "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
'
-test_expect_failure 'rev-parse --exclude=glob with --tags=glob' '
+test_expect_success 'rev-parse --exclude=glob with --tags=glob' '
compare rev-parse "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
'
-test_expect_failure 'rev-parse --exclude=glob with --remotes=glob' '
+test_expect_success 'rev-parse --exclude=glob with --remotes=glob' '
compare rev-parse "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
'
-test_expect_failure 'rev-parse --exclude=ref with --branches=glob' '
+test_expect_success 'rev-parse --exclude=ref with --branches=glob' '
compare rev-parse "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
'
-test_expect_failure 'rev-parse --exclude=ref with --tags=glob' '
+test_expect_success 'rev-parse --exclude=ref with --tags=glob' '
compare rev-parse "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
'
-test_expect_failure 'rev-parse --exclude=ref with --remotes=glob' '
+test_expect_success 'rev-parse --exclude=ref with --remotes=glob' '
compare rev-parse "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
'
-test_expect_failure 'rev-list --exclude=glob with --branches=glob' '
+test_expect_success 'rev-list --exclude=glob with --branches=glob' '
compare rev-list "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
'
-test_expect_failure 'rev-list --exclude=glob with --tags=glob' '
+test_expect_success 'rev-list --exclude=glob with --tags=glob' '
compare rev-list "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
'
-test_expect_failure 'rev-list --exclude=glob with --remotes=glob' '
+test_expect_success 'rev-list --exclude=glob with --remotes=glob' '
compare rev-list "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
'
-test_expect_failure 'rev-list --exclude=ref with --branches=glob' '
+test_expect_success 'rev-list --exclude=ref with --branches=glob' '
compare rev-list "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
'
-test_expect_failure 'rev-list --exclude=ref with --tags=glob' '
+test_expect_success 'rev-list --exclude=ref with --tags=glob' '
compare rev-list "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
'
-test_expect_failure 'rev-list --exclude=ref with --remotes=glob' '
+test_expect_success 'rev-list --exclude=ref with --remotes=glob' '
compare rev-list "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
'