Skip to content

Commit 4a611ee

Browse files
committed
Merge branch 'kn/ref-transaction-hook-with-reflog'
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 1f3d9b9 + b886db4 commit 4a611ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

refs.c

+3
Original file line numberDiff line numberDiff line change
@@ -2185,6 +2185,9 @@ static int run_transaction_hook(struct ref_transaction *transaction,
21852185
for (i = 0; i < transaction->nr; i++) {
21862186
struct ref_update *update = transaction->updates[i];
21872187

2188+
if (update->flags & REF_LOG_ONLY)
2189+
continue;
2190+
21882191
strbuf_reset(&buf);
21892192

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

t/t1416-ref-transaction-hooks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ test_expect_success 'hook gets all queued updates in prepared state' '
5353
fi
5454
EOF
5555
cat >expect <<-EOF &&
56-
$ZERO_OID $POST_OID HEAD
5756
$ZERO_OID $POST_OID refs/heads/main
5857
EOF
5958
git update-ref HEAD POST <<-EOF &&
@@ -76,7 +75,6 @@ test_expect_success 'hook gets all queued updates in committed state' '
7675
fi
7776
EOF
7877
cat >expect <<-EOF &&
79-
$ZERO_OID $POST_OID HEAD
8078
$ZERO_OID $POST_OID refs/heads/main
8179
EOF
8280
git update-ref HEAD POST &&

0 commit comments

Comments
 (0)