summaryrefslogtreecommitdiff
path: root/Limit
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-01-23 16:37:08 -0400
committerJoey Hess <joey@kitenet.net>2014-01-23 16:44:02 -0400
commit3518c586cfad6563b7ac2f0a02fb15efdbfad08d (patch)
treea3d1b8568a1b91648ddc4b53a55d48cc23c7cdb3 /Limit
parent90bc6e3137013c7c18fe8f1c3f843da79c74e399 (diff)
fix transfers of key with no associated file
Several places assumed this would not happen, and when the AssociatedFile was Nothing, did nothing. As part of this, preferred content checks pass the Key around. Note that checkMatcher is sometimes now called with Just Key and Just File. It currently constructs a FileMatcher, ignoring the Key. However, if it constructed a FileKeyMatcher, which contained both, then it might be possible to speed up parts of Limit, which currently call the somewhat expensive lookupFileKey to get the Key. I have not made this optimisation yet, because I am not sure if the key is always the same. Will need some significant checking to satisfy myself that's the case..
Diffstat (limited to 'Limit')
-rw-r--r--Limit/Wanted.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Limit/Wanted.hs b/Limit/Wanted.hs
index 7e92782029..01b8da6b34 100644
--- a/Limit/Wanted.hs
+++ b/Limit/Wanted.hs
@@ -13,10 +13,10 @@ import Limit
import Types.FileMatcher
addWantGet :: Annex ()
-addWantGet = addLimit $ Right $ const $ checkWant $ wantGet False
+addWantGet = addLimit $ Right $ const $ checkWant $ wantGet False Nothing
addWantDrop :: Annex ()
-addWantDrop = addLimit $ Right $ const $ checkWant $ wantDrop False Nothing
+addWantDrop = addLimit $ Right $ const $ checkWant $ wantDrop False Nothing Nothing
checkWant :: (Maybe FilePath -> Annex Bool) -> MatchInfo -> Annex Bool
checkWant a (MatchingFile fi) = a (Just $ matchFile fi)