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:
René Scharfe
2012-10-18 14:05:17 +02:00
committed by Junio C Hamano
parent 22ed792753
commit 566c7707db
2 changed files with 12 additions and 1 deletions

View File

@ -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'"),