mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-20 16:11:14 -03:00
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.
17 lines
211 B
Plaintext
17 lines
211 B
Plaintext
{}
|
|
{apple}
|
|
apple orange
|
|
apple orange
|
|
apple orange banana
|
|
'hello' 'world'
|
|
good, beautiful morning
|
|
goodbye, cruel world
|
|
'a'
|
|
'hello world'
|
|
alpha lambda, beta lambda, alpha gamma, beta gamma
|
|
Meg
|
|
Jo
|
|
Beth
|
|
Amy
|
|
{a} {b}
|