diff options
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Uninit.hs | 6 | ||||
-rw-r--r-- | Command/Unused.hs | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Command/Uninit.hs b/Command/Uninit.hs index ca18c478c..48f5b1ac1 100644 --- a/Command/Uninit.hs +++ b/Command/Uninit.hs @@ -26,9 +26,9 @@ check :: Annex () check = do b <- current_branch when (b == Annex.Branch.name) $ error $ - "cannot uninit when the " ++ b ++ " branch is checked out" + "cannot uninit when the " ++ show b ++ " branch is checked out" where - current_branch = head . lines . B.unpack <$> revhead + current_branch = Git.Ref . head . lines . B.unpack <$> revhead revhead = inRepo $ Git.pipeRead [Params "rev-parse --abbrev-ref HEAD"] @@ -57,5 +57,5 @@ cleanup = do liftIO $ removeDirectoryRecursive annexdir -- avoid normal shutdown saveState - inRepo $ Git.run "branch" [Param "-D", Param Annex.Branch.name] + inRepo $ Git.run "branch" [Param "-D", Param $ show Annex.Branch.name] liftIO exitSuccess diff --git a/Command/Unused.hs b/Command/Unused.hs index 34d8ac232..ccb9c48d8 100644 --- a/Command/Unused.hs +++ b/Command/Unused.hs @@ -152,12 +152,13 @@ excludeReferenced l = do (S.fromList l) where -- Skip the git-annex branches, and get all other unique refs. - refs = map last . + refs = map Git.Ref . + last . nubBy cmpheads . filter ourbranches . map words . lines . L.unpack cmpheads a b = head a == head b - ourbranchend = '/' : 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 @@ -188,7 +189,7 @@ getKeysReferenced = do return $ map fst $ catMaybes keypairs {- List of keys referenced by symlinks in a git ref. -} -getKeysReferencedInGit :: String -> Annex [Key] +getKeysReferencedInGit :: Git.Ref -> Annex [Key] getKeysReferencedInGit ref = do showAction $ "checking " ++ Git.refDescribe ref findkeys [] =<< inRepo (LsTree.lsTree ref) |