branch: delete symref branch, not its target
If a branch that is to be deleted happens to be a symref to another branch, the current code removes the targeted branch instead of the one it was called for. Change this surprising behaviour and delete the symref branch instead. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
22ed792753
commit
566c7707db
@ -239,7 +239,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (delete_ref(name, sha1, 0)) {
|
||||
if (delete_ref(name, sha1, REF_NODEREF)) {
|
||||
error(remote_branch
|
||||
? _("Error deleting remote branch '%s'")
|
||||
: _("Error deleting branch '%s'"),
|
||||
|
||||
Reference in New Issue
Block a user