X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=f85c438284d6b810617595971d7e3ec2e79e3120;hb=699eb54876669f0c109a34e0c01a9dd0c67725fa;hp=fecedd3b4635c79adcbe0e26613af079beff64d0;hpb=60f60b49629b6693ce5b8ce9201b2f6dd3989354;p=git.git diff --git a/branch.c b/branch.c index fecedd3b4..f85c43828 100644 --- a/branch.c +++ b/branch.c @@ -3,6 +3,7 @@ #include "refs.h" #include "remote.h" #include "commit.h" +#include "sequencer.h" struct tracking { struct refspec spec; @@ -159,7 +160,8 @@ int validate_new_branchname(const char *name, struct strbuf *ref, void create_branch(const char *head, const char *name, const char *start_name, - int force, int reflog, enum branch_track track) + int force, int reflog, int clobber_head, + enum branch_track track) { struct ref_lock *lock = NULL; struct commit *commit; @@ -174,7 +176,8 @@ void create_branch(const char *head, explicit_tracking = 1; if (validate_new_branchname(name, &ref, force, - track == BRANCH_TRACK_OVERRIDE)) { + track == BRANCH_TRACK_OVERRIDE || + clobber_head)) { if (!force) dont_change_ref = 1; else @@ -240,9 +243,11 @@ void create_branch(const char *head, void remove_branch_state(void) { unlink(git_path("CHERRY_PICK_HEAD")); + unlink(git_path("REVERT_HEAD")); unlink(git_path("MERGE_HEAD")); unlink(git_path("MERGE_RR")); unlink(git_path("MERGE_MSG")); unlink(git_path("MERGE_MODE")); unlink(git_path("SQUASH_MSG")); + remove_sequencer_state(0); }