Commit Graph

3 Commits

Author SHA1 Message Date
Fabian Homborg
967c1d51ee Only do brace expansion if they contain a variable or ","
Brace expansion with single words in it is quite useless - `HEAD@{0}`
expanding to `HEAD@0` breaks git.

So we complicate the rule slightly - if there is no variable expansion
or "," inside of braces, they are just treated as literal braces.

Note that this is technically backwards-incompatible, because

    echo foo{0}

will now print `foo{0}` instead of `foo0`. However that's a
technicality because the braces were literally useless in that case.

Our tests needed to be adjusted, but that's because they are meant to
exercise this in weird ways.

I don't believe this will break any code in practice.

Fixes #5869.
2019-05-19 18:23:27 +02:00
Mahmoud Al-Qudsi
2951fadc6b Fix parameter expansion tests on Travis macOS 2018-03-12 07:50:37 -05:00
Mahmoud Al-Qudsi
1e5d7d98a8 Add tests for new parameter expansion features 2018-03-12 07:04:05 -05:00