Merge branch 'js/rebase-r-and-merge-head'
authorJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2018 09:23:56 +0000 (18:23 +0900)
Bugfix for the recently graduated "git rebase --rebase-merges".

* js/rebase-r-and-merge-head:
status: rebase and merge can be in progress at the same time
built-in rebase --skip/--abort: clean up stale .git/<name> files
rebase -i: include MERGE_HEAD into files to clean up
rebase -r: do not write MERGE_HEAD unless needed
rebase -r: demonstrate bug with conflicting merges

1  2 
builtin/rebase.c
sequencer.c
index 337c5c7f99f748b802ed2d77bb8ed48672174fe9,017dce1b503c3b6c6858b421d42541a88daed88a..59e6f7852f5cd2ca77e0aef721f2875edd7a6794
@@@ -1018,9 -1001,9 +1019,10 @@@ int cmd_rebase(int argc, const char **a
                rerere_clear(&merge_rr);
                string_list_clear(&merge_rr, 1);
  
 -              if (reset_head(NULL, "reset", NULL, 0, NULL, NULL) < 0)
 +              if (reset_head(NULL, "reset", NULL, RESET_HEAD_HARD,
 +                             NULL, NULL) < 0)
                        die(_("could not discard worktree changes"));
+               remove_branch_state();
                if (read_basic_state(&options))
                        exit(1);
                goto run_rebase;
                if (read_basic_state(&options))
                        exit(1);
                if (reset_head(&options.orig_head, "reset",
 -                             options.head_name, 0, NULL, NULL) < 0)
 +                             options.head_name, RESET_HEAD_HARD,
 +                             NULL, NULL) < 0)
                        die(_("could not move back to %s"),
                            oid_to_hex(&options.orig_head));
+               remove_branch_state();
                ret = finish_rebase(&options);
                goto cleanup;
        }
diff --cc sequencer.c
Simple merge