summaryrefslogtreecommitdiff
path: root/Annex/Wanted.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/Wanted.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/Wanted.hs')
-rw-r--r--Annex/Wanted.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/Annex/Wanted.hs b/Annex/Wanted.hs
index d7c28efad..1d98cc0c2 100644
--- a/Annex/Wanted.hs
+++ b/Annex/Wanted.hs
@@ -9,7 +9,6 @@ module Annex.Wanted where
import Common.Annex
import Logs.PreferredContent
-import Git.FilePath
import Annex.UUID
import Types.Remote
@@ -18,22 +17,17 @@ import qualified Data.Set as S
{- Check if a file is preferred content for the local repository. -}
wantGet :: AssociatedFile -> Annex Bool
wantGet Nothing = return True
-wantGet (Just file) = do
- fp <- inRepo $ toTopFilePath file
- isPreferredContent Nothing S.empty fp
+wantGet (Just file) = isPreferredContent Nothing S.empty file
{- Check if a file is preferred content for a remote. -}
wantSend :: AssociatedFile -> UUID -> Annex Bool
wantSend Nothing _ = return True
-wantSend (Just file) to = do
- fp <- inRepo $ toTopFilePath file
- isPreferredContent (Just to) S.empty fp
+wantSend (Just file) to = isPreferredContent (Just to) S.empty file
{- Check if a file can be dropped, maybe from a remote.
- Don't drop files that are preferred content. -}
wantDrop :: Maybe UUID -> AssociatedFile -> Annex Bool
wantDrop _ Nothing = return True
wantDrop from (Just file) = do
- fp <- inRepo $ toTopFilePath file
u <- maybe getUUID (return . id) from
- not <$> isPreferredContent (Just u) (S.singleton u) fp
+ not <$> isPreferredContent (Just u) (S.singleton u) file