• Duy Nguyen's avatar
    wildmatch: adjust "**" behavior · 40bbee0a
    Duy Nguyen authored
    Standard wildmatch() sees consecutive asterisks as "*" that can also
    match slashes. But that may be hard to explain to users as
    "abc/**/def" can match "abcdef", "abcxyzdef", "abc/def", "abc/x/def",
    This patch changes wildmatch so that users can do
    - "**/def" -> all paths ending with file/directory 'def'
    - "abc/**" - equivalent to "/abc/"
    - "abc/**/def" -> "abc/x/def", "abc/x/y/def"...
    - otherwise consider the pattern malformed if "**" is found
    Basically the magic of "**" only remains if it's wrapped around by
    Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
t3070-wildmatch.sh 5.49 KB