From: Junio C Hamano Date: Thu, 13 Jun 2019 20:19:41 +0000 (-0700) Subject: Merge branch 'nd/merge-quit' X-Git-Tag: v2.23.0-rc0~134 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c4a38d161cbd3308825d7871d0f84f769aad04ab Merge branch 'nd/merge-quit' "git merge" learned "--quit" option that cleans up the in-progress merge while leaving the working tree and the index still in a mess. * nd/merge-quit: merge: add --quit merge: remove drop_save() in favor of remove_merge_branch_state() --- c4a38d161cbd3308825d7871d0f84f769aad04ab diff --cc branch.c index a594cc23e2,1db0601a11..e70838fb87 --- a/branch.c +++ b/branch.c @@@ -345,7 -343,14 +344,13 @@@ void remove_merge_branch_state(struct r unlink(git_path_merge_rr(r)); unlink(git_path_merge_msg(r)); unlink(git_path_merge_mode(r)); + } + + void remove_branch_state(struct repository *r) + { - unlink(git_path_cherry_pick_head(r)); - unlink(git_path_revert_head(r)); ++ sequencer_post_commit_cleanup(r); unlink(git_path_squash_msg(r)); + remove_merge_branch_state(r); } void die_if_checked_out(const char *branch, int ignore_current_worktree) diff --cc branch.h index 6f38db14e9,c90ba9d7bf..064ee576f2 --- a/branch.h +++ b/branch.h @@@ -58,8 -58,14 +58,14 @@@ int validate_branchname(const char *nam * Return 1 if the named branch already exists; return 0 otherwise. * Fill ref with the full refname for the branch. */ -extern int validate_new_branchname(const char *name, struct strbuf *ref, int force); +int validate_new_branchname(const char *name, struct strbuf *ref, int force); + /* + * Remove information about the merge state on the current + * branch. (E.g., MERGE_HEAD) + */ + void remove_merge_branch_state(struct repository *r); + /* * Remove information about the state of working on the current * branch. (E.g., MERGE_HEAD) diff --cc builtin/merge.c index e96f72af80,598d56edfe..5c83f89cc6 --- a/builtin/merge.c +++ b/builtin/merge.c @@@ -37,8 -37,8 +37,9 @@@ #include "packfile.h" #include "tag.h" #include "alias.h" + #include "branch.h" #include "commit-reach.h" +#include "wt-status.h" #define DEFAULT_TWOHEAD (1<<0) #define DEFAULT_OCTOPUS (1<<1)