diff --git a/Annex/Content.hs b/Annex/Content.hs index 6aef77830e..464b98f050 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -243,10 +243,9 @@ finishGetViaTmp check key action = do moveAnnex key tmpfile logStatus key InfoPresent return True - , do - -- the tmp file is left behind, in case caller wants - -- to resume its transfer - return False + -- the tmp file is left behind, in case caller wants + -- to resume its transfer + , return False ) prepTmp :: Key -> Annex FilePath diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs index b60ab9b1b3..7a4fba4559 100644 --- a/Annex/Content/Direct.hs +++ b/Annex/Content/Direct.hs @@ -66,7 +66,7 @@ changeAssociatedFiles key transform = do mapping <- calcRepo $ gitAnnexMapping key files <- associatedFilesRelative key let files' = transform files - when (files /= files') $ do + when (files /= files') $ modifyContent mapping $ liftIO $ viaTmp writeFileAnyEncoding mapping $ unlines files' diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 340c5c4756..495ce0d60d 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -184,7 +184,7 @@ mergeDirectCleanup d oldsha newsha = do tryAnnex . maybe (araw f item) (\k -> void $ a k f) =<< catKey (getsha item) (getmode item) - moveout k f = removeDirect k f + moveout = removeDirect {- Files deleted by the merge are removed from the work tree. - Empty work tree directories are removed, per git behavior. -} diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 158f3e787b..f3f98fde69 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -43,7 +43,7 @@ checkMatcher matcher mkey afile notpresent def fileMatchInfo :: FilePath -> Annex MatchInfo fileMatchInfo file = do matchfile <- getTopFilePath <$> inRepo (toTopFilePath file) - return $ MatchingFile $ FileInfo + return $ MatchingFile FileInfo { matchFile = matchfile , relFile = file } diff --git a/Annex/Init.hs b/Annex/Init.hs index 616bda69b5..43f24031c5 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -70,11 +70,10 @@ initialize mdescription = do ( do enableDirectMode setDirect True - , do - -- Handle case where this repo was cloned from a - -- direct mode repo. - unlessM isBare - switchHEADBack + -- Handle case where this repo was cloned from a + -- direct mode repo + , unlessM isBare + switchHEADBack ) createInodeSentinalFile u <- getUUID @@ -227,7 +226,7 @@ fixBadBare = whenM checkBadBare $ do logStatus k InfoPresent let dotgit = d ".git" liftIO $ removeDirectoryRecursive dotgit - `catchIO` (const $ renameDirectory dotgit (d "removeme")) + `catchIO` const (renameDirectory dotgit (d "removeme")) {- A repostory with the problem won't know it's a bare repository, but will - have no pre-commit hook (which is not set up in a bare repository), diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 8553ee797d..aedf418f87 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -76,7 +76,7 @@ bestSocketPath abssocketfile = do -- ssh appends a 16 char extension to the socket when setting it -- up, which needs to be taken into account when checking -- that a valid socket was constructed. - sshgarbage = take (1+16) $ repeat 'X' + sshgarbage = replicate (1+16) 'X' sshConnectionCachingParams :: FilePath -> [CommandParam] sshConnectionCachingParams socketfile =