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 26, 2006, 05:27 UTC
Message-ID
<7vlko7rydb.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060926072337.39dbb9f4.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
Show 15 quoted lines
> +LF='
> +'
> +
> +if [ -d "$GIT_DIR/refs/heads/$branchname" ]
> +then
> +	OLD_IFS="$IFS"
> +	IFS="$LF"
> +	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
> +	IFS="$OLD_IFS"
> +fi
I was sort of expecting that you would do something like:
	for refdir in `cd "$GIT_DIR" &&
		        find "refs/heads/$branchname" -type d |
		        sort -r`
	do                        
		rmdir "$GIT_DIR/$refdir" ...
wihtout mucking with IFS ;-). 
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 26, 2006
  2. Junio C HamanoSep 26, 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.