sequencer (rebase -i): run the post-rewrite hook, if needed
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ca98c6d487
commit
795160457d
14
sequencer.c
14
sequencer.c
@ -1957,6 +1957,8 @@ cleanup_head_ref:
|
|||||||
if (!stat(rebase_path_rewritten_list(), &st) &&
|
if (!stat(rebase_path_rewritten_list(), &st) &&
|
||||||
st.st_size > 0) {
|
st.st_size > 0) {
|
||||||
struct child_process child = CHILD_PROCESS_INIT;
|
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.in = open(rebase_path_rewritten_list(), O_RDONLY);
|
||||||
child.git_cmd = 1;
|
child.git_cmd = 1;
|
||||||
@ -1965,6 +1967,18 @@ cleanup_head_ref:
|
|||||||
argv_array_push(&child.args, "--for-rewrite=rebase");
|
argv_array_push(&child.args, "--for-rewrite=rebase");
|
||||||
/* we don't care if this copying failed */
|
/* we don't care if this copying failed */
|
||||||
run_command(&child);
|
run_command(&child);
|
||||||
|
|
||||||
|
if (post_rewrite_hook) {
|
||||||
|
struct child_process hook = CHILD_PROCESS_INIT;
|
||||||
|
|
||||||
|
hook.in = open(rebase_path_rewritten_list(),
|
||||||
|
O_RDONLY);
|
||||||
|
hook.stdout_to_stderr = 1;
|
||||||
|
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);
|
strbuf_release(&buf);
|
||||||
|
Loading…
Reference in New Issue
Block a user