]> git.ipfire.org Git - thirdparty/git.git/commitdiff
read-cache: convert post-index-change to use hook.h
authorEmily Shaffer <emilyshaffer@google.com>
Wed, 22 Dec 2021 03:59:41 +0000 (04:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jan 2022 23:19:35 +0000 (15:19 -0800)
Move the post-index-change hook away from run-command.h to and over to
the new hook.h library.

This removes the last direct user of "run_hook_ve()" outside of
run-command.c ("run_hook_le()" still uses it). So we can make the
function static now. A subsequent commit will remove this code
entirely when "run_hook_le()" itself goes away.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
run-command.c
run-command.h

index cbe73f14e5e7efc63b20e80a2702fb5c0dea9a5d..a7fbf144fecd5ce60a5df9c3e036b85568671157 100644 (file)
@@ -28,6 +28,7 @@
 #include "sparse-index.h"
 #include "csum-file.h"
 #include "promisor-remote.h"
+#include "hook.h"
 
 /* Mask for the name length in ce_flags in the on-disk index */
 
@@ -3150,7 +3151,7 @@ static int do_write_locked_index(struct index_state *istate, struct lock_file *l
        else
                ret = close_lock_file_gently(lock);
 
-       run_hook_le(NULL, "post-index-change",
+       run_hooks_l("post-index-change",
                        istate->updated_workdir ? "1" : "0",
                        istate->updated_skipworktree ? "1" : "0", NULL);
        istate->updated_workdir = 0;
index 3ea2c2fc101ffe7ab2d6bc4cee72e2b2efeba5dd..ea09de040a77d3df76c65614625f48334e4f3477 100644 (file)
@@ -1313,7 +1313,7 @@ int async_with_fork(void)
 #endif
 }
 
-int run_hook_ve(const char *const *env, const char *name, va_list args)
+static int run_hook_ve(const char *const *env, const char *name, va_list args)
 {
        struct child_process hook = CHILD_PROCESS_INIT;
        const char *p;
index 2be5f5d6422e54b84df300abd41974df3cd169da..88a398c300aa6a14acb02c7b61caeaf1636ca935 100644 (file)
@@ -235,7 +235,6 @@ int run_command(struct child_process *);
  */
 LAST_ARG_MUST_BE_NULL
 int run_hook_le(const char *const *env, const char *name, ...);
-int run_hook_ve(const char *const *env, const char *name, va_list args);
 
 /*
  * Trigger an auto-gc