]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/refs-exclude-fixes'
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Mar 2025 07:26:10 +0000 (16:26 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Mar 2025 07:26:10 +0000 (16:26 +0900)
The refname exclusion logic in the packed-ref backend has been
broken for some time, which confused upload-pack to advertise
different set of refs.  This has been corrected.

* tb/refs-exclude-fixes:
  refs.c: stop matching non-directory prefixes in exclude patterns
  refs.c: remove empty '--exclude' patterns

1  2 
refs.c
t/t1419-exclude-refs.sh

diff --cc refs.c
Simple merge
index c04eeb72111662a607479f78f496ce36e75e9f51,11d6dfdb251f506e1d8534b36e1827f902881960..04797aee59e03c105be451e8773179ec40d353d7
@@@ -89,19 -93,20 +93,27 @@@ test_expect_success 'adjacent, non-over
        for_each_ref refs/heads/foo refs/heads/quux >expect &&
  
        test_cmp expect actual &&
 -      assert_jumps 1 perf
 +      case "$GIT_DEFAULT_REF_FORMAT" in
 +      files)
 +              assert_jumps 1 perf;;
 +      reftable)
 +              assert_jumps 2 perf;;
 +      *)
 +              BUG "unhandled ref format $GIT_DEFAULT_REF_FORMAT";;
 +      esac
  '
  
- test_expect_success 'overlapping excluded regions' '
+ test_expect_success 'non-directory excluded regions' '
        for_each_ref__exclude refs/heads refs/heads/ba refs/heads/baz >actual 2>perf &&
-       for_each_ref refs/heads/foo refs/heads/quux >expect &&
+       for_each_ref refs/heads/bar refs/heads/foo refs/heads/quux >expect &&
+       test_cmp expect actual &&
+       assert_jumps 1 perf
+ '
+ test_expect_success 'overlapping excluded regions' '
+       for_each_ref__exclude refs/heads refs/heads/bar refs/heads/bar/4 >actual 2>perf &&
+       for_each_ref refs/heads/baz refs/heads/foo refs/heads/quux >expect &&
  
        test_cmp expect actual &&
        assert_jumps 1 perf