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

Re: [PATCH] Remove empty ref directories that prevent creating a ref.

From
Junio C Hamano <junkio@cox.net>
Date
Sep 24, 2006, 20:46 UTC
Message-ID
<7vy7s96lim.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060924223317.caf467a3.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 9 quoted lines
> +if [ -d "$GIT_DIR/refs/heads/$branchname" ]
> +then
> +	for refdir in `find "$GIT_DIR/refs/heads/$branchname" -type d | sort -r`
> +	do
> +		rmdir "$refdir" || \
> +		    die "Could not delete '$refdir', " \
> +		    "there may still be a ref there."
> +	done
> +fi

I do not think this loop is safe when $GIT_DIR contains any $IFS character.

Previous: Christian Couder
Message 2 of 2 in “Remove empty ref directories that prevent creating a ref.”
  1. Remove empty ref directories that prevent creating a ref.Christian Couder, Sep 24, 2006
  2. Junio C HamanoSep 24, 2006

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.