Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Christian Couder <chriscool@tuxfamily.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Remove empty ref directories that prevent creating a ref.
Date: Mon, 25 Sep 2006 22:27:28 -0700	[thread overview]
Message-ID: <7vlko7rydb.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <20060926072337.39dbb9f4.chriscool@tuxfamily.org> (Christian Couder's message of "Tue, 26 Sep 2006 07:23:37 +0200")

Christian Couder <chriscool@tuxfamily.org> writes:

> +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 ;-). 

  reply	other threads:[~2006-09-26  5:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-26  5:23 [PATCH] Remove empty ref directories that prevent creating a ref Christian Couder
2006-09-26  5:27 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-24 20:33 Christian Couder
2006-09-24 20:46 ` Junio C Hamano

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=7vlko7rydb.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox