Skip to content
Permalink
Browse files

Merge branch 'quote-braces'

This merges #1637 with an
added regression test and a new commit message ready for the next
merging rebase (where the faulty commit will be amended).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information...
dscho committed Apr 23, 2018
2 parents aa56ade + 3a3f8cb commit 20d8479690d49d7668700bd4658285b78c8bc490
Showing with 12 additions and 2 deletions.
  1. +2 −2 compat/mingw.c
  2. +10 −0 t/t0061-run-command.sh
@@ -1134,13 +1134,13 @@ static const char *quote_arg_msys2(const char *arg)

for (p = arg; *p; p++) {
int ws = isspace(*p);
if (!ws && *p != '\\' && *p != '"')
if (!ws && *p != '\\' && *p != '"' && *p != '{')
continue;
if (!buf.len)
strbuf_addch(&buf, '"');
if (p != p2)
strbuf_add(&buf, p2, p - p2);
if (!ws)
if (!ws && *p != '{')
strbuf_addch(&buf, '\\');
p2 = p;
}
@@ -182,4 +182,14 @@ test_expect_success 'GIT_TRACE with environment variables' '
)
'

test_expect_success MINGW 'verify curlies are quoted properly' '
: force the rev-parse through the MSYS2 Bash &&
git -c alias.r="!git rev-parse" r -- a{b}c >actual &&
cat >expect <<-\EOF &&
--
a{b}c
EOF
test_cmp expect actual
'

test_done

0 comments on commit 20d8479

Please sign in to comment.
You can’t perform that action at this time.