From: Junio C Hamano Date: Sun, 09 Mar 2008 10:24:20 GMT Subject: Re: [PATCH] builtin remote rm: remove symbolic refs, too Message-ID: <7vlk4sp54b.fsf@gitster.siamese.dyndns.org> In-Reply-To: Johannes Schindelin writes: > "git remote add" can add a symbolic ref "HEAD", and "rm" should delete > it, too. > > Noticed by Teemu Likonen. > > Signed-off-by: Johannes Schindelin > --- > builtin-remote.c | 5 +++++ > t/t5505-remote.sh | 1 + > 2 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/builtin-remote.c b/builtin-remote.c > index aa90cc9..f7653b6 100644 > --- a/builtin-remote.c > +++ b/builtin-remote.c > @@ -267,6 +267,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)); > + Heh, doing this in C is much easier and simpler ;-)