summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-09 01:57:13 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-09 01:57:13 -0400
commitd64132a43ae176e8a1353d5463c5387a93da9ad7 (patch)
treeb98b328a292807c00e4b9590e7cf3094ec176a49 /Command
parente3f1568e0ff7dc872f3782115c74b9e7d8c291b2 (diff)
hslint
Diffstat (limited to 'Command')
-rw-r--r--Command/Map.hs2
-rw-r--r--Command/Status.hs5
-rw-r--r--Command/Unused.hs5
3 files changed, 5 insertions, 7 deletions
diff --git a/Command/Map.hs b/Command/Map.hs
index 6b1e8d5bb..57b48d503 100644
--- a/Command/Map.hs
+++ b/Command/Map.hs
@@ -203,7 +203,7 @@ tryScan r
"git config --list"
dir = Git.workTree r
cddir
- | take 2 dir == "/~" =
+ | "/~" `isPrefixOf` dir =
let (userhome, reldir) = span (/= '/') (drop 1 dir)
in "cd " ++ userhome ++ " && cd " ++ shellEscape (drop 1 reldir)
| otherwise = "cd " ++ shellEscape dir
diff --git a/Command/Status.hs b/Command/Status.hs
index 0fefda1f6..09da41987 100644
--- a/Command/Status.hs
+++ b/Command/Status.hs
@@ -191,9 +191,8 @@ staleSize label dirspec = do
keys <- lift (Command.Unused.staleKeys dirspec)
if null keys
then nostat
- else do
- stat label $ json (++ aside "clean up with git-annex unused") $
- return $ keySizeSum $ S.fromList keys
+ else stat label $ json (++ aside "clean up with git-annex unused") $
+ return $ keySizeSum $ S.fromList keys
aside :: String -> String
aside s = " (" ++ s ++ ")"
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 7f9edfef2..be0107752 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -152,13 +152,12 @@ excludeReferenced l = do
(S.fromList l)
where
-- Skip the git-annex branches, and get all other unique refs.
- refs = map Git.Ref .
- map last .
+ refs = map (Git.Ref . last) .
nubBy cmpheads .
filter ourbranches .
map words . lines . L.unpack
cmpheads a b = head a == head b
- ourbranchend = '/' : show (Annex.Branch.name)
+ ourbranchend = '/' : show Annex.Branch.name
ourbranches ws = not $ ourbranchend `isSuffixOf` last ws
removewith [] s = return $ S.toList s
removewith (a:as) s