Skip to content

Commit dbb1c61

Browse files
nasamuffingitster
authored andcommitted
read-cache: convert post-index-change to use hook.h
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 <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Emily Shaffer <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f443246 commit dbb1c61

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

read-cache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "sparse-index.h"
2929
#include "csum-file.h"
3030
#include "promisor-remote.h"
31+
#include "hook.h"
3132

3233
/* Mask for the name length in ce_flags in the on-disk index */
3334

@@ -3150,7 +3151,7 @@ static int do_write_locked_index(struct index_state *istate, struct lock_file *l
31503151
else
31513152
ret = close_lock_file_gently(lock);
31523153

3153-
run_hook_le(NULL, "post-index-change",
3154+
run_hooks_l("post-index-change",
31543155
istate->updated_workdir ? "1" : "0",
31553156
istate->updated_skipworktree ? "1" : "0", NULL);
31563157
istate->updated_workdir = 0;

run-command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ int async_with_fork(void)
13131313
#endif
13141314
}
13151315

1316-
int run_hook_ve(const char *const *env, const char *name, va_list args)
1316+
static int run_hook_ve(const char *const *env, const char *name, va_list args)
13171317
{
13181318
struct child_process hook = CHILD_PROCESS_INIT;
13191319
const char *p;

run-command.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ int run_command(struct child_process *);
235235
*/
236236
LAST_ARG_MUST_BE_NULL
237237
int run_hook_le(const char *const *env, const char *name, ...);
238-
int run_hook_ve(const char *const *env, const char *name, va_list args);
239238

240239
/*
241240
* Trigger an auto-gc

0 commit comments

Comments
 (0)