Skip to content

Commit 7e79683

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 016a766 + b886db4 commit 7e79683

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
@@ -2225,6 +2225,9 @@ static int run_transaction_hook(struct ref_transaction *transaction,
22252225
for (i = 0; i < transaction->nr; i++) {
22262226
struct ref_update *update = transaction->updates[i];
22272227

2228+
if (update->flags & REF_LOG_ONLY)
2229+
continue;
2230+
22282231
strbuf_reset(&buf);
22292232

22302233
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)