Skip to content

Commit

Permalink
Merge branch 'kn/ref-transaction-hook-with-reflog' into seen
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Nov 16, 2024
2 parents 6a57e74 + b886db4 commit 0c38b84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions refs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,9 @@ static int run_transaction_hook(struct ref_transaction *transaction,
for (i = 0; i < transaction->nr; i++) {
struct ref_update *update = transaction->updates[i];

if (update->flags & REF_LOG_ONLY)
continue;

strbuf_reset(&buf);

if (!(update->flags & REF_HAVE_OLD))
Expand Down
2 changes: 0 additions & 2 deletions t/t1416-ref-transaction-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ test_expect_success 'hook gets all queued updates in prepared state' '
fi
EOF
cat >expect <<-EOF &&
$ZERO_OID $POST_OID HEAD
$ZERO_OID $POST_OID refs/heads/main
EOF
git update-ref HEAD POST <<-EOF &&
Expand All @@ -75,7 +74,6 @@ test_expect_success 'hook gets all queued updates in committed state' '
fi
EOF
cat >expect <<-EOF &&
$ZERO_OID $POST_OID HEAD
$ZERO_OID $POST_OID refs/heads/main
EOF
git update-ref HEAD POST &&
Expand Down

0 comments on commit 0c38b84

Please sign in to comment.