diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-06 14:54:02 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-06 14:54:02 -0800 |
commit | 9ca488c04bdab90668471640baeb0d9140be064c (patch) | |
tree | 6a1e4c6acaff06f234b12fdbb0b4ad9ab3bc8048 /sequencer.c | |
parent | 2cd91ec1970bd89e6b4b79b5aa41f27435625e71 (diff) | |
parent | fbd7a23237094c3fb2e249bbcacbbf1e858e79c9 (diff) | |
download | git-9ca488c04bdab90668471640baeb0d9140be064c.tar.gz |
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c index e9baaf59bd..c24ecdb21f 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)) |