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

@ -176,7 +176,7 @@ start o si file addunlockedmatcher = do
perform :: AddOptions -> RawFilePath -> AddUnlockedMatcher -> CommandPerform
perform o file addunlockedmatcher = withOtherTmp $ \tmpdir -> do
lockingfile <- not <$> addUnlocked addunlockedmatcher
(MatchingFile (FileInfo file file))
(MatchingFile (FileInfo (Just file) file))
let cfg = LockDownConfig
{ lockingFile = lockingfile
, hardlinkFileTmpDir = Just tmpdir