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.
This commit is contained in:
Joey Hess 2012-09-21 00:49:48 -04:00
parent 240711d1ae
commit 084aba8aaf
3 changed files with 13 additions and 14 deletions

View file

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