Merge branch 'ra/rev-parse-exclude-glob'
authorJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)
"rev-parse --exclude=<pattern> --branches=<pattern>" etc. did not
quite work, which has been corrected.

* ra/rev-parse-exclude-glob:
refs: fix some exclude patterns being ignored
refs: show --exclude failure with --branches/tags/remotes=glob

1  2 
refs.c
t/t6018-rev-list-glob.sh
diff --cc refs.c
Simple merge
index 270e579c2d3a30b2a08517bc63fe6edf5221af59,7dc6cbdc421d83e6cd83823ef0c8b199fee6d19c..bb5aeac07f8341ed44bfe25aba6238a92e1fc9e7
@@@ -141,18 -147,54 +147,66 @@@ test_expect_success 'rev-parse accumula
        compare rev-parse "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
  '
  
 +test_expect_success 'rev-parse --branches clears --exclude' '
 +      compare rev-parse "--exclude=* --branches --branches" "--branches"
 +'
 +
 +test_expect_success 'rev-parse --tags clears --exclude' '
 +      compare rev-parse "--exclude=* --tags --tags" "--tags"
 +'
 +
 +test_expect_success 'rev-parse --all clears --exclude' '
 +      compare rev-parse "--exclude=* --all --all" "--all"
 +'
 +
+ test_expect_success 'rev-parse --exclude=glob with --branches=glob' '
+       compare rev-parse "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
+ '
+ test_expect_success 'rev-parse --exclude=glob with --tags=glob' '
+       compare rev-parse "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
+ '
+ test_expect_success 'rev-parse --exclude=glob with --remotes=glob' '
+       compare rev-parse "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
+ '
+ test_expect_success 'rev-parse --exclude=ref with --branches=glob' '
+       compare rev-parse "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
+ '
+ test_expect_success 'rev-parse --exclude=ref with --tags=glob' '
+       compare rev-parse "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
+ '
+ test_expect_success 'rev-parse --exclude=ref with --remotes=glob' '
+       compare rev-parse "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
+ '
+ test_expect_success 'rev-list --exclude=glob with --branches=glob' '
+       compare rev-list "--exclude=subspace-* --branches=sub*" "subspace/one subspace/two"
+ '
+ test_expect_success 'rev-list --exclude=glob with --tags=glob' '
+       compare rev-list "--exclude=qux/? --tags=qux/*" "qux/one qux/two"
+ '
+ test_expect_success 'rev-list --exclude=glob with --remotes=glob' '
+       compare rev-list "--exclude=upstream/? --remotes=upstream/*" "upstream/one upstream/two"
+ '
+ test_expect_success 'rev-list --exclude=ref with --branches=glob' '
+       compare rev-list "--exclude=subspace-x --branches=sub*" "subspace/one subspace/two"
+ '
+ test_expect_success 'rev-list --exclude=ref with --tags=glob' '
+       compare rev-list "--exclude=qux/x --tags=qux/*" "qux/one qux/two"
+ '
+ test_expect_success 'rev-list --exclude=ref with --remotes=glob' '
+       compare rev-list "--exclude=upstream/x --remotes=upstream/*" "upstream/one upstream/two"
+ '
  test_expect_success 'rev-list --glob=refs/heads/subspace/*' '
  
        compare rev-list "subspace/one subspace/two" "--glob=refs/heads/subspace/*"