allow matching on files whose content is not present

Anything that needs to examine the file content will fail to match,
or fall back to other available information. But the intent is that the
matcher be checked for matchNeedsFileContent and only be used if it does
not, so the exact behavior doesn't much matter as it should never
happen.

The real point of this is to not need to provide a dummy content file
when matching.

This commit was sponsored by Martin D on Patreon.
This commit is contained in:
Joey Hess 2020-09-28 11:08:30 -04:00
parent 9e676f062f
commit 00dbe35fbc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
11 changed files with 40 additions and 30 deletions

View file

@ -25,8 +25,9 @@ data MatchInfo
| MatchingInfo ProvidedInfo
data FileInfo = FileInfo
{ currFile :: RawFilePath
-- ^ current path to the file, for operations that examine it
{ contentFile :: Maybe RawFilePath
-- ^ path to a file containing the content, for operations
-- that examine it
, matchFile :: RawFilePath
-- ^ filepath to match on; may be relative to top of repo or cwd
}