mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
mingw: Quote '{}' to work around an error in MSYS' glob()
MSYS expands '{}' in paths even if the pattern between the
braces does not contain a comma. See
http://article.gmane.org/gmane.comp.version-control.msysgit/2341
for a detailed discussion.
This commit fixes (at least) the case of "git stash apply stash@{1}".
Note that "git-stash apply stash@{1}" works even without this patch
(because it is executed directly by /bin/sh).
Note that git-stash still has a bug whereby it doesn't validate
its final argument ("stash@{1}" in this case). This commit does
nothing to fix that problem.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
@@ -380,7 +380,7 @@ static const char *quote_arg(const char *arg)
|
||||
const char *p = arg;
|
||||
if (!*p) force_quotes = 1;
|
||||
while (*p) {
|
||||
if (isspace(*p) || *p == '*' || *p == '?')
|
||||
if (isspace(*p) || *p == '*' || *p == '?' || *p == '{')
|
||||
force_quotes = 1;
|
||||
else if (*p == '"')
|
||||
n++;
|
||||
|
||||
Reference in New Issue
Block a user