summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:02 (GMT)
commit9ca488c04bdab90668471640baeb0d9140be064c (patch)
tree6a1e4c6acaff06f234b12fdbb0b4ad9ab3bc8048 /sequencer.c
parent2cd91ec1970bd89e6b4b79b5aa41f27435625e71 (diff)
parentfbd7a23237094c3fb2e249bbcacbbf1e858e79c9 (diff)
downloadgit-9ca488c04bdab90668471640baeb0d9140be064c.zip
git-9ca488c04bdab90668471640baeb0d9140be064c.tar.gz
git-9ca488c04bdab90668471640baeb0d9140be064c.tar.bz2
Merge branch 'nd/rebase-show-current-patch'
The new "--show-current-patch" option gives an end-user facing way to get the diff being applied when "git rebase" (and "git am") stops with a conflict. * nd/rebase-show-current-patch: rebase: introduce and use pseudo-ref REBASE_HEAD rebase: add --show-current-patch am: add --show-current-patch
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index e9baaf5..c24ecdb 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2314,6 +2314,9 @@ static int make_patch(struct commit *commit, struct replay_opts *opts)
p = short_commit_name(commit);
if (write_message(p, strlen(p), rebase_path_stopped_sha(), 1) < 0)
return -1;
+ if (update_ref("rebase", "REBASE_HEAD", &commit->object.oid,
+ NULL, REF_NO_DEREF, UPDATE_REFS_MSG_ON_ERR))
+ res |= error(_("could not update %s"), "REBASE_HEAD");
strbuf_addf(&buf, "%s/patch", get_dir(opts));
memset(&log_tree_opt, 0, sizeof(log_tree_opt));
@@ -2565,6 +2568,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
unlink(rebase_path_author_script());
unlink(rebase_path_stopped_sha());
unlink(rebase_path_amend());
+ delete_ref(NULL, "REBASE_HEAD", NULL, REF_NO_DEREF);
}
if (item->command <= TODO_SQUASH) {
if (is_rebase_i(opts))