summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-02 15:28:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 22:57:30 (GMT)
commit795160457db0982c44cc02f66798a35af4d15625 (patch)
tree261add60a0040655dcbfe6060fb64e837fad44d4 /sequencer.c
parentca98c6d4870d9743ee1fab9f70d1f455895811d6 (diff)
downloadgit-795160457db0982c44cc02f66798a35af4d15625.zip
git-795160457db0982c44cc02f66798a35af4d15625.tar.gz
git-795160457db0982c44cc02f66798a35af4d15625.tar.bz2
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index d7273fd..43ced8d 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1957,6 +1957,8 @@ cleanup_head_ref:
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;
@@ -1965,6 +1967,18 @@ cleanup_head_ref:
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);
+ 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);