diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-06-05 09:03:15 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-05 09:03:15 +0900 |
commit | e6f80aee299f530c9565b520aa76e6ff2e5649bc (patch) | |
tree | c66968077cfc4333c2fe703cdc090383d7a3711e /remote.c | |
parent | a07148db319e8d0080ba2b7fc85501cd7bbba6b5 (diff) | |
parent | d9244ecf4f109030e61b8fd52a799789133e2199 (diff) | |
download | git-e6f80aee299f530c9565b520aa76e6ff2e5649bc.tar.gz |
Merge branch 'js/bs-is-a-dir-sep-on-windows' into maint
"foo\bar\baz" in "git fetch foo\bar\baz", even though there is no
slashes in it, cannot be a nickname for a remote on Windows, as
that is likely to be a pathname on a local filesystem.
* js/bs-is-a-dir-sep-on-windows:
Windows: do not treat a path with backslashes as a remote's nick name
mingw.h: permit arguments with side effects for is_dir_sep
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -649,7 +649,12 @@ static int valid_remote_nick(const char *name) { if (!name[0] || is_dot_or_dotdot(name)) return 0; - return !strchr(name, '/'); /* no slash */ + + /* remote nicknames cannot contain slashes */ + while (*name) + if (is_dir_sep(*name++)) + return 0; + return 1; } const char *remote_for_branch(struct branch *branch, int *explicit) |