X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=branch.c;h=d7fd267b7ed189eaca02caf6628969b50169ec45;hb=39af78961d8e7f4c0aee73e77e9eb5b6033f79c2;hp=d8098762f62a9dfb991f64702d34047182cfa951;hpb=84a9ea90e1d704bcac9d26837dff9e3cd7609376;p=git.git diff --git a/branch.c b/branch.c index d8098762f..d7fd267b7 100644 --- a/branch.c +++ b/branch.c @@ -3,7 +3,6 @@ #include "refs.h" #include "remote.h" #include "commit.h" -#include "sequencer.h" struct tracking { struct refspec spec; @@ -160,7 +159,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; @@ -175,7 +175,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 @@ -241,10 +242,10 @@ 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); }