From e80353490db56e21d266a384141d39f50797e8e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 11 Apr 2015 00:10:34 -0400 Subject: a few hlints --- Annex/AutoMerge.hs | 2 +- Annex/Content.hs | 2 +- Annex/Content/Direct.hs | 2 +- Annex/Difference.hs | 4 ++-- Annex/DirHashes.hs | 2 +- Annex/FileMatcher.hs | 4 ++-- Annex/MetaData.hs | 4 ++-- Annex/Notification.hs | 2 +- Annex/View.hs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) (limited to 'Annex') diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs index f0f183dfb..5ffa7b073 100644 --- a/Annex/AutoMerge.hs +++ b/Annex/AutoMerge.hs @@ -37,7 +37,7 @@ import qualified Data.Set as S - Callers should use Git.Branch.changed first, to make sure that - there are changed from the current branch to the branch being merged in. -} -autoMergeFrom :: Git.Ref -> (Maybe Git.Ref) -> Git.Branch.CommitMode -> Annex Bool +autoMergeFrom :: Git.Ref -> Maybe Git.Ref -> Git.Branch.CommitMode -> Annex Bool autoMergeFrom branch currbranch commitmode = do showOutput case currbranch of diff --git a/Annex/Content.hs b/Annex/Content.hs index 17050224d..9d70ccee3 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -538,7 +538,7 @@ getKeysPresent keyloc = do -} getstate direct = do when direct $ - void $ inodesChanged + void inodesChanged Annex.getState id {- Things to do to record changes to content when shutting down. diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index e6a9b5eda..86e053d7f 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -257,7 +257,7 @@ annexSentinalFile :: Annex SentinalFile annexSentinalFile = do sentinalfile <- fromRepo gitAnnexInodeSentinal sentinalcachefile <- fromRepo gitAnnexInodeSentinalCache - return $ SentinalFile + return SentinalFile { sentinalFile = sentinalfile , sentinalCacheFile = sentinalcachefile } diff --git a/Annex/Difference.hs b/Annex/Difference.hs index 66dc03a32..e0dc17da7 100644 --- a/Annex/Difference.hs +++ b/Annex/Difference.hs @@ -38,10 +38,10 @@ setDifferences = do ( do oldds <- recordedDifferencesFor u when (ds /= oldds) $ - warning $ "Cannot change tunable parameters in already initialized repository." + warning "Cannot change tunable parameters in already initialized repository." return oldds , if otherds == mempty - then ifM (not . null . filter (/= u) . M.keys <$> uuidMap) + then ifM (any (/= u) . M.keys <$> uuidMap) ( do warning "Cannot change tunable parameters in a clone of an existing repository." return mempty diff --git a/Annex/DirHashes.hs b/Annex/DirHashes.hs index 03769350d..91c3e7817 100644 --- a/Annex/DirHashes.hs +++ b/Annex/DirHashes.hs @@ -46,7 +46,7 @@ configHashLevels d config | otherwise = def branchHashDir :: GitConfig -> Key -> String -branchHashDir config key = hashDirLower (branchHashLevels config) key +branchHashDir = hashDirLower . branchHashLevels {- Two different directory hashes may be used. The mixed case hash - came first, and is fine, except for the problem of case-strict diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 0de4d83d1..9677e65dd 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -24,10 +24,10 @@ import Types.Remote (RemoteConfig) import Data.Either import qualified Data.Set as S -checkFileMatcher :: (FileMatcher Annex) -> FilePath -> Annex Bool +checkFileMatcher :: FileMatcher Annex -> FilePath -> Annex Bool checkFileMatcher matcher file = checkMatcher matcher Nothing (Just file) S.empty True -checkMatcher :: (FileMatcher Annex) -> Maybe Key -> AssociatedFile -> AssumeNotPresent -> Bool -> Annex Bool +checkMatcher :: FileMatcher Annex -> Maybe Key -> AssociatedFile -> AssumeNotPresent -> Bool -> Annex Bool checkMatcher matcher mkey afile notpresent d | isEmpty matcher = return d | otherwise = case (mkey, afile) of diff --git a/Annex/MetaData.hs b/Annex/MetaData.hs index 3b776a6d7..0751bbb49 100644 --- a/Annex/MetaData.hs +++ b/Annex/MetaData.hs @@ -36,7 +36,7 @@ import Data.Time.Clock.POSIX -} genMetaData :: Key -> FilePath -> FileStatus -> Annex () genMetaData key file status = do - maybe noop (flip copyMetaData key) =<< catKeyFileHEAD file + maybe noop (`copyMetaData` key) =<< catKeyFileHEAD file whenM (annexGenMetaData <$> Annex.getGitConfig) $ do curr <- getCurrentMetaData key addMetaData key (dateMetaData mtime curr) @@ -52,4 +52,4 @@ dateMetaData mtime old = MetaData $ M.fromList $ filter isnew ] where isnew (f, _) = S.null (currentMetaDataValues f old) - (y, m, _d) = toGregorian $ utctDay $ mtime + (y, m, _d) = toGregorian $ utctDay mtime diff --git a/Annex/Notification.hs b/Annex/Notification.hs index 25f1ee678..a7b757e50 100644 --- a/Annex/Notification.hs +++ b/Annex/Notification.hs @@ -43,7 +43,7 @@ notifyTransfer direction (Just f) a = do return ok else a NotifyWitness #else -notifyTransfer _ (Just _) a = do a NotifyWitness +notifyTransfer _ (Just _) a = a NotifyWitness #endif notifyDrop :: Maybe FilePath -> Bool -> Annex () diff --git a/Annex/View.hs b/Annex/View.hs index 315cc7df2..2b8a80e5f 100644 --- a/Annex/View.hs +++ b/Annex/View.hs @@ -314,7 +314,7 @@ getViewedFileMetaData = getDirMetaData . dirFromViewedFile . takeFileName - branch for the view. -} applyView :: View -> Annex Git.Branch -applyView view = applyView' viewedFileFromReference getWorkTreeMetaData view +applyView = applyView' viewedFileFromReference getWorkTreeMetaData {- Generates a new branch for a View, which must be a more narrow - version of the View originally used to generate the currently -- cgit v1.2.3