Skip to content

Commit 21bc276

Browse files
committed
sequencer (rebase -i): run the post-rewrite hook, if needed
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 3a70368 commit 21bc276

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

sequencer.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,6 +1879,8 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
18791879
flush_rewritten_pending();
18801880
if (!stat(rewritten_list(), &st) && st.st_size > 0) {
18811881
struct child_process child = CHILD_PROCESS_INIT;
1882+
const char *post_rewrite_hook =
1883+
find_hook("post-rewrite");
18821884

18831885
child.in = open(rewritten_list(), O_RDONLY);
18841886
child.git_cmd = 1;
@@ -1887,6 +1889,16 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
18871889
argv_array_push(&child.args, "--for-rewrite=rebase");
18881890
/* we don't care if this copying failed */
18891891
run_command(&child);
1892+
1893+
if (post_rewrite_hook) {
1894+
struct child_process hook = CHILD_PROCESS_INIT;
1895+
1896+
hook.in = open(rewritten_list(), O_RDONLY);
1897+
argv_array_push(&hook.args, post_rewrite_hook);
1898+
argv_array_push(&hook.args, "rebase");
1899+
/* we don't care if this hook failed */
1900+
run_command(&hook);
1901+
}
18901902
}
18911903
apply_autostash(opts);
18921904

0 commit comments

Comments
 (0)