From: Junio C Hamano Date: Sat, 10 Oct 2009 21:50:18 GMT Subject: Re: [PATCH] disallow refs containing successive slashes Message-ID: <7vws327wbp.fsf@alter.siamese.dyndns.org> In-Reply-To: <4AD0C93C.6050306@web.de> Jens Lehmann writes: > When creating branches using names starting with '/' or containing a '//', > a leading slash would just vanish and successive slashes were 'compressed' > into just one slash. Hmm. We already do that without your patch. $ git branch /foo//bar $ git for-each-ref --format='%(refname)' refs/heads/foo/bar refs/heads/master $ git branch -d /foo//bar Deleted branch /foo//bar (was deadbeef) $ git for-each-ref --format='%(refname)' refs/heads/master > Signed-off-by: Jens Lehmann > --- > > I became aware of this issue while looking into problems occuring > when a user created a branch starting with a '/' in git gui (e.g. > "/foo"). Strange things happen, while git gui shows the current > branch as "/foo" under the hood a branch "foo" (without the slash) > had been created. But then you can't delete "/foo" from git gui, > because a branch of that name doesn't exist. Perhaps an interface to give a cleaned-up version, e.g. $ git check-ref-format --print refs/heads//foo/bar refs/heads/foo/bar is what you want in order to fix git-gui? I dunno.