Subject: Re: [JGIT PATCH] Added forward slash to head/remote/tag prefix Constants

From: "Shawn O. Pearce" <[email-masked]>
Date: Fri, 22 Aug 2008 09:53:27 -0700

Charles O'Farrell <[email-masked]> wrote:
> eg. Constants.HEADS_PREFIX + "/" ==> Constants.R_HEADS
> 
> This was always done by every instance anyway and so this will ensure
> it isn't forgotten again.

Thanks, applied.  I had to hand-merge a few sections due to Marek's
push UI going in before your patch, but your patch not having the
necessary changes.  Using a different constant name helped make
that resolution less painful.
 
> --- a/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
> +++ b/org.spearce.jgit.pgm/src/org/spearce/jgit/pgm/TextBuiltin.java
> @@ -184,12 +181,12 @@ protected static String abbreviateObject(final ObjectId id) {
>  	}
>  
>  	protected String abbreviateRef(String dst, boolean abbreviateRemote) {
> -		if (dst.startsWith(REFS_HEADS))
> -			dst = dst.substring(REFS_HEADS.length());
> -		else if (dst.startsWith(REFS_TAGS))
> -			dst = dst.substring(REFS_TAGS.length());
> -		else if (abbreviateRemote && dst.startsWith(REFS_REMOTES))
> -			dst = dst.substring(REFS_REMOTES.length());
> +		if (dst.startsWith(R_HEADS))
> +			dst = dst.substring(R_HEADS.length());
> +		else if (dst.startsWith(R_TAGS))
> +			dst = dst.substring(R_HEADS.length());

This should be R_TAGS. I fixed it when I applied the patch.

-- 
Shawn.