The code correctly detects that forced creation of a branch on a nonbare repo should not be able to overwrite a branch which is the HEAD reference. But there's no reason to prevent this on a bare repo, and in fact, git allows this. I.e., git branch -f master new_sha works on a bare repo with HEAD set to master. This change fixes that problem, and updates tests so that, for this case, both the bare and nonbare cases are checked for correct behavior.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
branches | Loading commit data... | |
reflog | Loading commit data... | |
crashes.c | Loading commit data... | |
create.c | Loading commit data... | |
createwithlog.c | Loading commit data... | |
delete.c | Loading commit data... | |
dup.c | Loading commit data... | |
foreachglob.c | Loading commit data... | |
isvalidname.c | Loading commit data... | |
iterator.c | Loading commit data... | |
list.c | Loading commit data... | |
listall.c | Loading commit data... | |
lookup.c | Loading commit data... | |
normalize.c | Loading commit data... | |
overwrite.c | Loading commit data... | |
pack.c | Loading commit data... | |
peel.c | Loading commit data... | |
races.c | Loading commit data... | |
read.c | Loading commit data... | |
ref_helpers.c | Loading commit data... | |
ref_helpers.h | Loading commit data... | |
rename.c | Loading commit data... | |
revparse.c | Loading commit data... | |
settargetwithlog.c | Loading commit data... | |
setter.c | Loading commit data... | |
shorthand.c | Loading commit data... | |
transactions.c | Loading commit data... | |
unicode.c | Loading commit data... | |
update.c | Loading commit data... |