summaryrefslogtreecommitdiff
path: root/Types/FileMatcher.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2020-12-14 17:42:02 -0400
committerJoey Hess <joeyh@joeyh.name>2020-12-14 17:42:02 -0400
commit01527b21d8bcdf0783a5bb2683f4fa6151d1dc7c (patch)
tree7c268ee7566dbceff6083aa938a8584030286596 /Types/FileMatcher.hs
parent205a837e8a711876ea19a829d6da527ca0c8ae5c (diff)
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.
Diffstat (limited to 'Types/FileMatcher.hs')
-rw-r--r--Types/FileMatcher.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Types/FileMatcher.hs b/Types/FileMatcher.hs
index 70d9e40d7f..3b5adca1de 100644
--- a/Types/FileMatcher.hs
+++ b/Types/FileMatcher.hs
@@ -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