All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Teemu Likonen <tlikonen@iki.fi>,
	git@vger.kernel.org, James Bowes <jbowes@dangerouslyinc.com>
Subject: Re: [PATCH] builtin remote rm: remove symbolic refs, too
Date: Sun, 09 Mar 2008 03:24:20 -0700	[thread overview]
Message-ID: <7vlk4sp54b.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0803082339060.3975@racer.site> (Johannes Schindelin's message of "Sat, 8 Mar 2008 23:40:42 +0100 (CET)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> 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 <johannes.schindelin@gmx.de>
> ---
>  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 ;-)

  reply	other threads:[~2008-03-09 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 11:38 error: refs/remotes/origin/HEAD points nowhere! Teemu Likonen
2008-03-05 21:24 ` Junio C Hamano
2008-03-06  7:50   ` Teemu Likonen
2008-03-08 22:40   ` [PATCH] builtin remote rm: remove symbolic refs, too Johannes Schindelin
2008-03-09 10:24     ` Junio C Hamano [this message]
2008-03-07 21:02 ` [PATCH/RFC] Make "git remote rm <remote>" remove file refs/remotes/<remote>/HEAD Teemu Likonen
2008-03-07 22:18   ` Teemu Likonen
2008-03-08  1:45   ` Junio C Hamano
2008-03-08  1:46   ` Junio C Hamano
2008-03-08  6:16     ` Teemu Likonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vlk4sp54b.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jbowes@dangerouslyinc.com \
    --cc=tlikonen@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.