Subject: Re: [PATCH 3/4] Prepare testsuite for a "git clone" that packs refs

From: Jakub Narebski <[email-masked]>
Date: Sun, 15 Jun 2008 11:04:07 -0700 (PDT)

Jeff King <[email-masked]> writes:

> On Sun, Jun 15, 2008 at 04:05:47PM +0200, Johan Herland wrote:
> 
> > .git/packed-refs. This patch therefore teaches t5515-fetch-merge-logic
> > to also remove the refs in question from the packed-refs file.
> > [...]
> > +			cat .git/packed-refs | \
> > +			while read sha1 refname
> > +			do
> > +				case "$sha1" in
> > +				^*) # remove peeled tags
> > +					;;
> > +				*)
> > +					case "$refname" in
> > +					refs/heads/*|\
> > +					refs/remotes/rem/*|\
> > +					refs/tags/*) # remove same as above
> > +						;;
> > +					*) # keep everything else
> > +						echo "$sha1 $refname"
> > +						;;
> > +					esac
> > +				esac
> > +			done > .git/packed-refs.new
> > +			mv .git/packed-refs.new .git/packed-refs
> 
> Might it not be simpler to just convert it to use plumbing to delete the
> refs? Something like piping for-each-ref into update-ref -d?

Or use git-for-each-ref with --shell option to generate code for
deleting refs?

-- 
Jakub Narebski
Poland
ShadeHawk on #git