Skip to content

Commit 7a5d612

Browse files
committed
Merge branch 'kn/ref-transaction-hook-with-reflog' into seen
The ref-transaction hook triggered for reflog updates, which has been corrected. * kn/ref-transaction-hook-with-reflog: refs: don't invoke reference-transaction hook for reflogs
2 parents 17f780e + b886db4 commit 7a5d612

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

refs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2217,6 +2217,9 @@ static int run_transaction_hook(struct ref_transaction *transaction,
22172217
for (i = 0; i < transaction->nr; i++) {
22182218
struct ref_update *update = transaction->updates[i];
22192219

2220+
if (update->flags & REF_LOG_ONLY)
2221+
continue;
2222+
22202223
strbuf_reset(&buf);
22212224

22222225
if (!(update->flags & REF_HAVE_OLD))

t/t1416-ref-transaction-hooks.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ test_expect_success 'hook gets all queued updates in prepared state' '
5252
fi
5353
EOF
5454
cat >expect <<-EOF &&
55-
$ZERO_OID $POST_OID HEAD
5655
$ZERO_OID $POST_OID refs/heads/main
5756
EOF
5857
git update-ref HEAD POST <<-EOF &&
@@ -75,7 +74,6 @@ test_expect_success 'hook gets all queued updates in committed state' '
7574
fi
7675
EOF
7776
cat >expect <<-EOF &&
78-
$ZERO_OID $POST_OID HEAD
7977
$ZERO_OID $POST_OID refs/heads/main
8078
EOF
8179
git update-ref HEAD POST &&

0 commit comments

Comments
 (0)