This commit is contained in:
Joey Hess 2011-12-09 01:57:13 -04:00
parent e3f1568e0f
commit d64132a43a
16 changed files with 25 additions and 29 deletions

View file

@ -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

View file

@ -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 ++ ")"

View file

@ -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