summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--run-command.c2
-rw-r--r--run-command.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/run-command.c b/run-command.c
index 6e29fdf9e2..73d0c31276 100644
--- a/run-command.c
+++ b/run-command.c
@@ -110,6 +110,8 @@ int start_command(struct child_process *cmd)
unsetenv(*cmd->env);
}
}
+ if (cmd->preexec_cb)
+ cmd->preexec_cb();
if (cmd->git_cmd) {
execv_git_cmd(cmd->argv);
} else {
diff --git a/run-command.h b/run-command.h
index 5203a9ebb1..4f2b7d7d40 100644
--- a/run-command.h
+++ b/run-command.h
@@ -42,6 +42,7 @@ struct child_process {
unsigned no_stderr:1;
unsigned git_cmd:1; /* if this is to be git sub-command */
unsigned stdout_to_stderr:1;
+ void (*preexec_cb)(void);
};
int start_command(struct child_process *);