Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-12-11 19:11:35 +0300
committerJunio C Hamano <gitster@pobox.com>2018-12-28 23:49:48 +0300
commit45339f74ef87123ab79831310bf8047cebe5177b (patch)
tree14111c37d5934fd02e6e7556a3c4269038dc6f33 /builtin/am.c
parent5400677903bdb852e0ca89e41e009afb8a1b6239 (diff)
am, rebase--merge: do not overlook --skip'ed commits with post-rewrite
The post-rewrite hook is supposed to be invoked for each rewritten commit. The fact that a commit was selected and processed by the rebase operation (even though when we hit an error a user said it had no more useful changes), suggests we should write an entry for it. In particular, let's treat it as an empty commit trivially squashed into its parent. This brings the rebase--am and rebase--merge backends in sync with the behavior of the interactive rebase backend. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 8f27f3375b1..af9d0348383 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2000,6 +2000,15 @@ static void am_skip(struct am_state *state)
if (clean_index(&head, &head))
die(_("failed to clean index"));
+ if (state->rebasing) {
+ FILE *fp = xfopen(am_path(state, "rewritten"), "a");
+
+ assert(!is_null_oid(&state->orig_commit));
+ fprintf(fp, "%s ", oid_to_hex(&state->orig_commit));
+ fprintf(fp, "%s\n", oid_to_hex(&head));
+ fclose(fp);
+ }
+
am_next(state);
am_load(state);
am_run(state, 0);