summaryrefslogtreecommitdiff
path: root/branch.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-05-09 10:10:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-13 02:49:14 (GMT)
commitb64335554a3691cbc134fb73a598dfd593f44b4e (patch)
treeacb8599602a92beeeeb5f692a0705535d71d44a5 /branch.c
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
downloadgit-b64335554a3691cbc134fb73a598dfd593f44b4e.zip
git-b64335554a3691cbc134fb73a598dfd593f44b4e.tar.gz
git-b64335554a3691cbc134fb73a598dfd593f44b4e.tar.bz2
merge: remove drop_save() in favor of remove_merge_branch_state()
Both remove_branch_state() and drop_save() delete almost the same set of files about the current merge state. The only difference is MERGE_RR but it should also be cleaned up after a successful merge, which is what drop_save() is for. Make a new function that deletes all merge-related state files and use it instead of drop_save(). This function will also be used in the next patch that introduces --quit. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/branch.c b/branch.c
index 28b81a7..1db0601 100644
--- a/branch.c
+++ b/branch.c
@@ -337,15 +337,20 @@ void create_branch(struct repository *r,
free(real_ref);
}
-void remove_branch_state(struct repository *r)
+void remove_merge_branch_state(struct repository *r)
{
- unlink(git_path_cherry_pick_head(r));
- unlink(git_path_revert_head(r));
unlink(git_path_merge_head(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));
unlink(git_path_squash_msg(r));
+ remove_merge_branch_state(r);
}
void die_if_checked_out(const char *branch, int ignore_current_worktree)