diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-12-28 11:32:33 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-28 11:32:33 -0800 |
commit | 79587741cbed7704d2e7213c999cf2841af3000d (patch) | |
tree | ac065e7bd784619dbc5cc47e543860b57f71adb3 /branch.c | |
parent | e39888ba21b68888e1db2d989155f23ea78fc842 (diff) | |
parent | 39bd6f726109942c6f77f59638f6763c9f00706c (diff) |
Merge branch 'jn/branch-move-to-self' into maint
* jn/branch-move-to-self:
Allow checkout -B <current-branch> to update the current branch
branch: allow a no-op "branch -M <current-branch> HEAD"
Diffstat (limited to 'branch.c')
-rw-r--r-- | branch.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -160,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; @@ -175,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 |