ensure outgoing sync pushes always succeed when repo is accessible

The fallback branches pushed to contain the uuid of the pusher, which is
ugly. That's why syncing doesn't normally use this method.

The merger deletes fallback branches after merging them, to contain the
ugliness, and so unused doesn't look at data from these branches.
(The fallback git-annex branch is left behind for now.)
This commit is contained in:
Joey Hess 2012-09-16 19:48:12 -04:00
parent 6cddda4143
commit ddacbbe798
2 changed files with 73 additions and 24 deletions

View file

@ -15,6 +15,7 @@ import qualified Annex.Branch
import qualified Git
import qualified Git.Merge
import qualified Git.Branch
import qualified Git.Command as Git
thisThread :: ThreadName
thisThread = "Merger"
@ -81,6 +82,11 @@ onAdd g file _
, show current
]
void $ Git.Merge.mergeNonInteractive changedbranch g
when ("fallback/" `isInfixOf` (show changedbranch)) $
void $ Git.runBool "branch"
[ Param "-D"
, Param $ show changedbranch
] g
go _ = noop
equivBranches :: Git.Ref -> Git.Ref -> Bool