-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the issue
As mentioned in #5914 (comment), we have a fairly large number of places in our test suite where we perform grep(1) commands using regular expressions in which we have not fully escaped all the meta-characters like . and *.
For instance, this check in a test from t/t-migrate-export.sh aims to confirm that git lfs track outputs the expected "*.jpg" already supported message:
git lfs track "*.jpg" | grep "\"*.jpg\" already supported"
However, this would match if the message contained the string XYZjpg" already supported or Zjpg" already supported (but not jpg" already supported) because the "* matches zero or more " characters, and the . matches any character.
System environment
The examples above were performed on macOS, but should behave the same way on any platform.
Output of git lfs env
git-lfs/3.5.1 (GitHub; darwin arm64; go 1.22.1)
git version 2.47.0
Additional context
There are a significant number of these kinds of oversights in our tests' regular expressions, mostly involving meta-characters like . and *, since those are frequently used in filenames and shell wildcards.