Re: [PATCH] disallow refs containing successive slashes
Jens Lehmann <Jens.Lehmann@web.de> 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/masterShow 9 quoted lines
> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
> ---
>
> 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/baris what you want in order to fix git-gui? I dunno.