add key to FileInfo

MatchingKey is not the thing to use when matching on actual worktreee
files.

Fix reversion in 8.20201116 that made include= and exclude= in
preferred/required content expressions match a path relative to the current
directory, rather than the path from the top of the repository.
This commit is contained in:
Joey Hess 2020-12-14 17:42:02 -04:00
parent 205a837e8a
commit 01527b21d8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
13 changed files with 48 additions and 13 deletions

View file

@ -18,10 +18,13 @@ import Control.Monad.IO.Class
import qualified Data.Map as M
import qualified Data.Set as S
-- Information about a file or a key that can be matched on.
-- Information about a file and/or a key that can be matched on.
data MatchInfo
= MatchingFile FileInfo
| MatchingKey Key AssociatedFile
-- ^ This is used when operating on a file that may be in another
-- branch. The AssociatedFile is the filename, but it should not be
-- accessed from disk when matching.
| MatchingInfo ProvidedInfo
| MatchingUserInfo UserProvidedInfo
@ -33,6 +36,8 @@ data FileInfo = FileInfo
-- ^ filepath to match on; may be relative to top of repo or cwd,
-- depending on how globs in preferred content expressions
-- are intended to be matched
, matchKey :: Maybe Key
-- ^ provided if a key is already known
}
data ProvidedInfo = ProvidedInfo