summaryrefslogtreecommitdiff
path: root/Types/FileMatcher.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2020-09-28 11:08:30 -0400
committerJoey Hess <joeyh@joeyh.name>2020-09-28 11:17:46 -0400
commit00dbe35fbc7261767551ba35193b3af20a6c9c1d (patch)
treed66580af5f7f89931e73920e33816ae0815eac84 /Types/FileMatcher.hs
parent9e676f062f7b89ee1663f4edcba9b3268df5dfac (diff)
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.
Diffstat (limited to 'Types/FileMatcher.hs')
-rw-r--r--Types/FileMatcher.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Types/FileMatcher.hs b/Types/FileMatcher.hs
index 5903d36f7e..8f7f94f323 100644
--- a/Types/FileMatcher.hs
+++ b/Types/FileMatcher.hs
@@ -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
}