diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-12-14 07:53:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-14 07:53:08 +0100 |
commit | b2dd02112052aff875e8dc7d12b9915c91feafe2 (patch) | |
tree | 575640076625dbc13dd950e78f8c0ab5f23e2b06 /branch.c | |
parent | Merge branch 'cn/maint-lf-to-crlf-filter' (diff) | |
parent | Allow checkout -B <current-branch> to update the current branch (diff) | |
download | git-b2dd02112052aff875e8dc7d12b9915c91feafe2.tar.xz git-b2dd02112052aff875e8dc7d12b9915c91feafe2.zip |
Merge branch 'jn/branch-move-to-self'
* 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
@@ -191,7 +191,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; @@ -206,7 +207,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 |