From: Johannes Schindelin Date: Sat, 8 Mar 2008 22:40:42 +0000 (+0100) Subject: builtin remote rm: remove symbolic refs, too X-Git-Tag: v1.5.5-rc0~24^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3b9dcff5df97ab642de48bc1ce781961686081aa;p=git.git builtin remote rm: remove symbolic refs, too "git remote add" can add a symbolic ref "HEAD", and "rm" should delete it, too. Noticed by Teemu Likonen. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/builtin-remote.c b/builtin-remote.c index ca3bf265a..637b90425 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -264,6 +264,11 @@ static int add_branch_for_removal(const char *refname, if (!prefixcmp(refname, branches->prefix)) { struct path_list_item *item; + + /* make sure that symrefs are deleted */ + if (flags & REF_ISSYMREF) + return unlink(git_path(refname)); + item = path_list_append(refname, branches->branches); item->util = xmalloc(20); hashcpy(item->util, sha1); diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index f45ea68f6..2822a651b 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -80,6 +80,7 @@ test_expect_success 'add another remote' ' test_expect_success 'remove remote' ' ( cd test && + git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master && git remote rm second ) '