sequencer (rebase -i): skip some revert/cherry-pick specific code path
[gitweb.git] / sequencer.c
index 52e17c8887ad73a1c94debef8a28ec379691774a..a7b9ee0d04295eca714cacc706aae6af65c6d9bd 100644 (file)
@@ -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);