better name for fallback sync refs

Don't expose these as branches in refs/heads/. Instead hide them away in
refs/synced/ where only show-ref will find them.

Make unused only look at branches and tags, not these other things,
so it won't care if some stale sync ref used to use a file.

This means they don't need to be deleted, which could have
led to an incoming sync being missed.
This commit is contained in:
Joey Hess 2012-09-16 23:09:08 -04:00
parent 2081a31fda
commit ba744c84a4
4 changed files with 15 additions and 20 deletions

View file

@ -251,7 +251,9 @@ withKeysReferencedInGit a = do
rs <- relevantrefs <$> showref
forM_ rs (withKeysReferencedInGitRef a)
where
showref = inRepo $ Git.Command.pipeRead [Param "show-ref"]
{- List heads and tags, but not other refs used in syncing. -}
showref = inRepo $ Git.Command.pipeRead
[Param "show-ref", Param "--heads", Param "--tags"]
relevantrefs = map (Git.Ref . snd) .
nubBy uniqref .
filter ourbranches .