summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-01-02 15:27:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-09 22:57:29 (GMT)
commit4258a6da90988439af1d6008a3172d25efcbf2a1 (patch)
tree388629d35105036ccb00464b1330cde905404a33 /sequencer.c
parent5263220967209c7a64c065054fb64036815ac2ee (diff)
downloadgit-4258a6da90988439af1d6008a3172d25efcbf2a1.zip
git-4258a6da90988439af1d6008a3172d25efcbf2a1.tar.gz
git-4258a6da90988439af1d6008a3172d25efcbf2a1.tar.bz2
sequencer (rebase -i): skip some revert/cherry-pick specific code path
When a cherry-pick continues without a "todo script", the intention is simply to pick a single commit. However, when an interactive rebase is continued without a "todo script", it means that the last command has been completed and that we now need to clean up. This commit guards the revert/cherry-pick specific steps so that they are not executed in rebase -i mode. 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.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/sequencer.c b/sequencer.c
index 52e17c8..a7b9ee0 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1878,26 +1878,28 @@ int sequencer_continue(struct replay_opts *opts)
if (is_rebase_i(opts)) {
if (commit_staged_changes(opts))
return -1;
- }
- if (!file_exists(get_todo_path(opts)))
+ } else if (!file_exists(get_todo_path(opts)))
return continue_single_pick();
if (read_populate_opts(opts))
return -1;
if ((res = read_populate_todo(&todo_list, opts)))
goto release_todo_list;
- /* Verify that the conflict has been resolved */
- if (file_exists(git_path_cherry_pick_head()) ||
- file_exists(git_path_revert_head())) {
- res = continue_single_pick();
- if (res)
+ if (!is_rebase_i(opts)) {
+ /* Verify that the conflict has been resolved */
+ if (file_exists(git_path_cherry_pick_head()) ||
+ file_exists(git_path_revert_head())) {
+ res = continue_single_pick();
+ if (res)
+ goto release_todo_list;
+ }
+ if (index_differs_from("HEAD", 0, 0)) {
+ res = error_dirty_index(opts);
goto release_todo_list;
+ }
+ todo_list.current++;
}
- if (index_differs_from("HEAD", 0, 0)) {
- res = error_dirty_index(opts);
- goto release_todo_list;
- }
- todo_list.current++;
+
res = pick_commits(&todo_list, opts);
release_todo_list:
todo_list_release(&todo_list);