diff options
author | Joey Hess <joey@kitenet.net> | 2011-11-11 01:52:58 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-11-11 01:52:58 -0400 |
commit | 637b5feb45013f69f3aacbafeb796de666d3faa3 (patch) | |
tree | 17e5506c3715be46318d15dd76ec474641faffe2 /Command | |
parent | b327227ba596d4fc5012138d03390c3eb861b808 (diff) |
lint
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Describe.hs | 2 | ||||
-rw-r--r-- | Command/FromKey.hs | 2 | ||||
-rw-r--r-- | Command/Fsck.hs | 4 | ||||
-rw-r--r-- | Command/Migrate.hs | 4 | ||||
-rw-r--r-- | Command/Move.hs | 4 | ||||
-rw-r--r-- | Command/Uninit.hs | 4 |
6 files changed, 10 insertions, 10 deletions
diff --git a/Command/Describe.hs b/Command/Describe.hs index 1cc81bcbd..61297e77c 100644 --- a/Command/Describe.hs +++ b/Command/Describe.hs @@ -24,7 +24,7 @@ start (name:description) = do showStart "describe" name u <- Remote.nameToUUID name next $ perform u $ unwords description -start _ = do error "Specify a repository and a description." +start _ = error "Specify a repository and a description." perform :: UUID -> String -> CommandPerform perform u description = do diff --git a/Command/FromKey.hs b/Command/FromKey.hs index b910dd1f0..ec194e06e 100644 --- a/Command/FromKey.hs +++ b/Command/FromKey.hs @@ -22,7 +22,7 @@ seek = [withWords start] start :: [String] -> CommandStart start (keyname:file:[]) = notBareRepo $ do - let key = maybe (error "bad key") id $ readKey keyname + let key = fromMaybe (error "bad key") $ readKey keyname inbackend <- inAnnex key unless inbackend $ error $ "key ("++ keyname ++") is not present in backend" diff --git a/Command/Fsck.hs b/Command/Fsck.hs index bdc509941..99dda99e5 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -50,7 +50,7 @@ withBarePresentKeys a params = isBareRepo >>= go where go False = return [] go True = do - unless (null params) $ do + unless (null params) $ error "fsck should be run without parameters in a bare repository" prepStart a loggedKeys @@ -137,7 +137,7 @@ checkKeySize key = do checkBackend :: Backend Annex -> Key -> Annex Bool -checkBackend backend key = (Types.Backend.fsckKey backend) key +checkBackend = Types.Backend.fsckKey checkKeyNumCopies :: Key -> FilePath -> Maybe Int -> Annex Bool checkKeyNumCopies key file numcopies = do diff --git a/Command/Migrate.hs b/Command/Migrate.hs index 3c87f4136..860c4bd47 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -46,7 +46,7 @@ perform file oldkey newbackend = do -- The old backend's key is not dropped from it, because there may -- be other files still pointing at that key. src <- fromRepo $ gitAnnexLocation oldkey - tmp <- fromRepo $ gitAnnexTmpDir + tmp <- fromRepo gitAnnexTmpDir let tmpfile = tmp </> takeFileName file liftIO $ createLink src tmpfile k <- Backend.genKey tmpfile $ Just newbackend @@ -64,7 +64,7 @@ perform file oldkey newbackend = do -- associated urls, record them for -- the new key as well. urls <- getUrls oldkey - when (not $ null urls) $ + unless (null urls) $ mapM_ (setUrlPresent newkey) urls next $ Command.Add.cleanup file newkey True diff --git a/Command/Move.hs b/Command/Move.hs index 9553d1639..155f4d605 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -82,7 +82,7 @@ toPerform dest move key = moveLock move key $ do else Remote.hasKey dest key case isthere of Left err -> do - showNote $ err + showNote err stop Right False -> do showAction $ "to " ++ Remote.name dest @@ -111,7 +111,7 @@ toPerform dest move key = moveLock move key $ do -} fromStart :: Remote.Remote Annex -> Bool -> FilePath -> Key -> CommandStart fromStart src move file key - | move == True = go + | move = go | otherwise = do ishere <- inAnnex key if ishere then stop else go diff --git a/Command/Uninit.hs b/Command/Uninit.hs index 8987240be..ca18c478c 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -51,11 +51,11 @@ perform = next cleanup cleanup :: CommandCleanup cleanup = do - annexdir <- fromRepo $ gitAnnexDir + annexdir <- fromRepo gitAnnexDir uninitialize mapM_ removeAnnex =<< getKeysPresent liftIO $ removeDirectoryRecursive annexdir -- avoid normal shutdown saveState inRepo $ Git.run "branch" [Param "-D", Param Annex.Branch.name] - liftIO $ exitSuccess + liftIO exitSuccess |