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 6e29fdf..73d0c31 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 5203a9e..4f2b7d7 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 *);