summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-21 00:49:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-21 00:49:48 -0400
commit084aba8aaf43fed5d9c694c19ff1cd53e7b16bc8 (patch)
tree2f33fea02008cbbe6e63e76a8ff74520bce492bf /Command
parent240711d1aeada93172f98e1686593e4ac634450a (diff)
fix breakage caught by test suite
Can't use show-ref --tags --branches, as that omits remote branches. Instead, filter out the synced refs directly.
Diffstat (limited to 'Command')
-rw-r--r--Command/Unused.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index f5eb4b7dd..91b21afa5 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -251,16 +251,15 @@ withKeysReferencedInGit a = do
rs <- relevantrefs <$> showref
forM_ rs (withKeysReferencedInGitRef a)
where
- {- List heads and tags, but not other refs used in syncing. -}
- showref = inRepo $ Git.Command.pipeRead
- [Param "show-ref", Param "--heads", Param "--tags"]
+ showref = inRepo $ Git.Command.pipeRead [Param "show-ref"]
relevantrefs = map (Git.Ref . snd) .
nubBy uniqref .
filter ourbranches .
map (separate (== ' ')) . lines
uniqref (x, _) (y, _) = x == y
ourbranchend = '/' : show Annex.Branch.name
- ourbranches (_, b) = not $ ourbranchend `isSuffixOf` b
+ ourbranches (_, b) = not (ourbranchend `isSuffixOf` b)
+ && not ("refs/synced/" `isPrefixOf` b)
withKeysReferencedInGitRef :: (Key -> Annex ()) -> Git.Ref -> Annex ()
withKeysReferencedInGitRef a ref = do