git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin remote rm: remove symbolic refs, too

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 9, 2008, 10:24 UTC
Message-ID
<7vlk4sp54b.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LSU.1.00.0803082339060.3975@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 24 quoted lines
> "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 ;-)
Previous: Johannes SchindelinNext: Teemu Likonen
Message 5 of 10 in “error: refs/remotes/origin/HEAD points nowhere!”
  1. Teemu LikonenMar 5, 2008
  2. Junio C HamanoMar 5, 2008
  3. Teemu LikonenMar 6, 2008
  4. builtin remote rm: remove symbolic refs, tooJohannes Schindelin, Mar 8, 2008
  5. Junio C HamanoMar 9, 2008
  6. Make "git remote rm <remote>" remove file refs/remotes/<remote>/HEADTeemu Likonen, Mar 7, 2008
  7. Teemu LikonenMar 7, 2008
  8. Junio C HamanoMar 8, 2008
  9. Junio C HamanoMar 8, 2008
  10. Teemu LikonenMar 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.