From b1013825f97b4f5a8097c25ee2a3cd4679f38f24 Mon Sep 17 00:00:00 2001 From: raible Date: Sun, 8 Jun 2008 09:51:32 +0200 Subject: [PATCH] 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 --- compat/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index a5b43bcf6f..95ba563a27 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -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++;