author | Junio C Hamano <junkio@cox.net> | |
Sat, 25 Nov 2006 07:10:23 +0000 (23:10 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 25 Nov 2006 07:10:23 +0000 (23:10 -0800) | ||
commit | 67affd5173da059ca60aab7896985331acacd9b4 | |
tree | 59ba5a6fcf43fa2b4bbf13fabf644086699fc0b6 | tree | snapshot |
parent | 75e6e2132006770156d9df1881b4114862919c94 | commit | diff |
git-branch -D: make it work even when on a yet-to-be-born branch
This makes "git branch -D other_branch" work even when HEAD
points at a yet-to-be-born branch.
Earlier, we checked the HEAD ref for the purpose of "subset"
check even when the deletion was forced (i.e. not -d but -D).
Because of this, you cannot delete a branch even with -D while
on a yet-to-be-born branch.
With this change, the following sequence that now works:
mkdir newdir && cd newdir
git init-db
git fetch -k $other_repo refs/heads/master:refs/heads/othre
# oops, typo
git branch other othre
git branch -D othre
Signed-off-by: Junio C Hamano <junkio@cox.net>
This makes "git branch -D other_branch" work even when HEAD
points at a yet-to-be-born branch.
Earlier, we checked the HEAD ref for the purpose of "subset"
check even when the deletion was forced (i.e. not -d but -D).
Because of this, you cannot delete a branch even with -D while
on a yet-to-be-born branch.
With this change, the following sequence that now works:
mkdir newdir && cd newdir
git init-db
git fetch -k $other_repo refs/heads/master:refs/heads/othre
# oops, typo
git branch other othre
git branch -D othre
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-branch.c | diff | blob | history |