Re: [PATCHv2 04/10] remote: Reject remote names containing '/'
From: Eric Sunshine <hidden>
Date: 2016-06-15 22:57:13
On Sat, May 11, 2013 at 12:21 PM, Johan Herland [off-list ref] wrote:
Although we definitely support and encourage use of multi-level branch names, we have never conciously tried to give support for multi-level
s/conciously/consciously/
remote names. Currently, they are allowed, but there is no evidence that they are commonly used. Now, they do provide a source of problems when trying to expand the "$nick/$name" shorthand notation (where $nick matches a remote name) into a full refname. Consider the shorthand "foo/bar/baz": Does this parse as $nick = foo, $name = bar/baz, or $nick = foo/bar, $name = baz? Since we need to be unambiguous about these things, we hereby declare that a remote name shall never contain a '/' character, and that the only correct way to parse "foo/bar/baz" is $nick = foo, $name = bar/baz. This patch teaches 'git remote' to reject remote names with slashes, and adds tests verifying this. Signed-off-by: Johan Herland <redacted>