t6302: add test combining '--start-after' with '--exclude'

The '--start-after' doesn't explicitly mention being compatible with the '--exclude' flag, generally only incompatibility is explicitly called out. However, it would be nice to test the compatibility between the two to avoid future regressions. Let's do that. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Karthik Nayak committed Jul 28, 2025 at 22:20 UTC ed9cc2144c97b3ad609d71b6033a95079179fc0e
1 file changed +19
t/t6302-for-each-ref-filter.sh
+19
@@ -712,6 +712,25 @@ test_expect_success 'start after, overflow specific reference path' '
712 test_cmp expect actual
713 '
714
715 +test_expect_success 'start after, with exclude pattern' '
716 + cat >expect <<-\EOF &&
717 + refs/tags/annotated-tag
718 + refs/tags/doubly-annotated-tag
719 + refs/tags/doubly-signed-tag
720 + refs/tags/foo1.10
721 + refs/tags/foo1.3
722 + refs/tags/foo1.6
723 + refs/tags/four
724 + refs/tags/one
725 + refs/tags/signed-tag
726 + refs/tags/three
727 + refs/tags/two
728 + EOF
729 + git for-each-ref --format="%(refname)" --start-after=refs/odd/spot \
730 + --exclude=refs/tags/foo >actual &&
731 + test_cmp expect actual
732 +'
733 +
734 test_expect_success 'start after, last reference' '
735 cat >expect <<-\EOF &&
736 EOF