Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2022-01-17 11:12:39 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-17 22:01:45 +0300
commit958fbc74e3d0fcc88b2065190e23db556a963644 (patch)
tree903aaaef928b0f51d2e29707b44bc178b874ee0a /refs.c
parentfbe73f61cbc29f6c4a85478cf792c37dbe5aa26c (diff)
refs: allow skipping the reference-transaction hook
The reference-transaction hook is executing whenever we prepare, commit or abort a reference transaction. While this is mostly intentional, in case of the files backend we're leaking the implementation detail that the store is in fact a composite store with one loose and one packed backend to the caller. So while we want to execute the hook for all logical updates, executing it for such implementation details is unexpected. Prepare for a fix by adding a new flag which allows to skip execution of the hook. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index 7415864b62..526bf5ed97 100644
--- a/refs.c
+++ b/refs.c
@@ -2084,6 +2084,9 @@ static int run_transaction_hook(struct ref_transaction *transaction,
const char *hook;
int ret = 0, i;
+ if (transaction->flags & REF_TRANSACTION_SKIP_HOOK)
+ return 0;
+
hook = find_hook("reference-transaction");
if (!hook)
return ret;