aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-08-01 11:27:11 -0700
committerJunio C Hamano <gitster@pobox.com>2025-08-01 11:27:11 -0700
commita2384a76e7d62ee5a628c82ee4e29c16c14c0168 (patch)
tree3c2a240673a5912999b7b4a86facc4691236f610 /t
parent152871b88b317e3c0781d2503de2b8a37bcc2146 (diff)
parent26552cb62a5b375d4df651184941edf84f88a485 (diff)
downloadgit-a2384a76e7d62ee5a628c82ee4e29c16c14c0168.tar.gz
Merge branch 'jk/unleak-reflog-expire-entry'
Leakfix. * jk/unleak-reflog-expire-entry: reflog: close leak of reflog expire entry
Diffstat (limited to 't')
-rwxr-xr-xt/t1410-reflog.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 42b501f163..e30f87a358 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -673,4 +673,32 @@ test_expect_success 'reflog drop --all with reference' '
)
'
+test_expect_success 'expire with pattern config' '
+ # Split refs/heads/ into two roots so we can apply config to each. Make
+ # two branches per root to verify that config is applied correctly
+ # multiple times.
+ git branch root1/branch1 &&
+ git branch root1/branch2 &&
+ git branch root2/branch1 &&
+ git branch root2/branch2 &&
+
+ test_config "gc.reflogexpire" "never" &&
+ test_config "gc.refs/heads/root2/*.reflogExpire" "now" &&
+ git reflog expire \
+ root1/branch1 root1/branch2 \
+ root2/branch1 root2/branch2 &&
+
+ cat >expect <<-\EOF &&
+ root1/branch1@{0}
+ root1/branch2@{0}
+ EOF
+ git log -g --branches="root*" --format=%gD >actual.raw &&
+ # The sole reflog entry of each branch points to the same commit, so
+ # the order in which they are shown is nondeterministic. We just care
+ # about the what was expired (and what was not), so sort to get a known
+ # order.
+ sort <actual.raw >actual.sorted &&
+ test_cmp expect actual.sorted
+'
+
test_done