mirror of
https://github.com/git/git.git
synced 2026-01-28 03:22:25 +00:00
sequencer (rebase -i): run the post-rewrite hook, if needed
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
13
sequencer.c
13
sequencer.c
@@ -1923,6 +1923,8 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
|
||||
if (!stat(rebase_path_rewritten_list(), &st) &&
|
||||
st.st_size > 0) {
|
||||
struct child_process child = CHILD_PROCESS_INIT;
|
||||
const char *post_rewrite_hook =
|
||||
find_hook("post-rewrite");
|
||||
|
||||
child.in = open(rebase_path_rewritten_list(), O_RDONLY);
|
||||
child.git_cmd = 1;
|
||||
@@ -1931,6 +1933,17 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
|
||||
argv_array_push(&child.args, "--for-rewrite=rebase");
|
||||
/* we don't care if this copying failed */
|
||||
run_command(&child);
|
||||
|
||||
if (post_rewrite_hook) {
|
||||
struct child_process hook = CHILD_PROCESS_INIT;
|
||||
|
||||
hook.in = open(rebase_path_rewritten_list(),
|
||||
O_RDONLY);
|
||||
argv_array_push(&hook.args, post_rewrite_hook);
|
||||
argv_array_push(&hook.args, "rebase");
|
||||
/* we don't care if this hook failed */
|
||||
run_command(&hook);
|
||||
}
|
||||
}
|
||||
|
||||
strbuf_release(&buf);
|
||||
|
||||
Reference in New Issue
Block a user