summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-17 16:01:09 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-17 16:01:09 -0400
commit998f57820295857891d123ca1592c9c2e54e94c1 (patch)
treebaf0a9f39457dc6c51d7c0408e126da74397204a /Annex.hs
parent2c7c9811b3253e293535680762709adacecc0f2a (diff)
Preferred content path matching bugfix.
When in a subdir, both the normal filepath, and the filepath relative to the top of the git repo are needed for matching. The former for key lookup, and the latter for include/exclude to match against. Previously, key lookup didn't work in this situation.
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Annex.hs b/Annex.hs
index a4a56f5ff..1cadaed51 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -10,6 +10,7 @@
module Annex (
Annex,
AnnexState(..),
+ FileInfo(..),
PreferredContentMap,
new,
newState,
@@ -77,7 +78,12 @@ instance MonadBaseControl IO Annex where
type Matcher a = Either [Utility.Matcher.Token a] (Utility.Matcher.Matcher a)
-type PreferredContentMap = M.Map UUID (Utility.Matcher.Matcher (S.Set UUID -> FilePath -> Annex Bool))
+data FileInfo = FileInfo
+ { relFile :: FilePath -- may be relative to cwd
+ , matchFile :: FilePath -- filepath to match on; may be relative to top
+ }
+
+type PreferredContentMap = M.Map UUID (Utility.Matcher.Matcher (S.Set UUID -> FileInfo -> Annex Bool))
-- internal state storage
data AnnexState = AnnexState
@@ -94,7 +100,7 @@ data AnnexState = AnnexState
, checkattrhandle :: Maybe CheckAttrHandle
, forcebackend :: Maybe String
, forcenumcopies :: Maybe Int
- , limit :: Matcher (FilePath -> Annex Bool)
+ , limit :: Matcher (FileInfo -> Annex Bool)
, preferredcontentmap :: Maybe PreferredContentMap
, shared :: Maybe SharedRepository
, forcetrust :: TrustMap