Skip to content

Commit 20d8479

Browse files
committed
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 <[email protected]>
2 parents aa56ade + 3a3f8cb commit 20d8479

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

compat/mingw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,13 +1134,13 @@ static const char *quote_arg_msys2(const char *arg)
11341134

11351135
for (p = arg; *p; p++) {
11361136
int ws = isspace(*p);
1137-
if (!ws && *p != '\\' && *p != '"')
1137+
if (!ws && *p != '\\' && *p != '"' && *p != '{')
11381138
continue;
11391139
if (!buf.len)
11401140
strbuf_addch(&buf, '"');
11411141
if (p != p2)
11421142
strbuf_add(&buf, p2, p - p2);
1143-
if (!ws)
1143+
if (!ws && *p != '{')
11441144
strbuf_addch(&buf, '\\');
11451145
p2 = p;
11461146
}

t/t0061-run-command.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,14 @@ test_expect_success 'GIT_TRACE with environment variables' '
182182
)
183183
'
184184

185+
test_expect_success MINGW 'verify curlies are quoted properly' '
186+
: force the rev-parse through the MSYS2 Bash &&
187+
git -c alias.r="!git rev-parse" r -- a{b}c >actual &&
188+
cat >expect <<-\EOF &&
189+
--
190+
a{b}c
191+
EOF
192+
test_cmp expect actual
193+
'
194+
185195
test_done

0 commit comments

Comments
 (0)