diff options
author | 2012-09-16 17:54:12 -0400 | |
---|---|---|
committer | 2012-09-16 17:54:12 -0400 | |
commit | 601ee470af277ad3d0041b6ce425d808075dc997 (patch) | |
tree | d15de1ea91f0bb7f4ddaa5d09324ee47cb0caae7 /Command | |
parent | e61512f42da04f424b70a345d42976296a1a7360 (diff) |
sync: Pushes the git-annex branch to remote/synced/git-annex, rather than directly to remote/git-annex.
This fixes a problem I was seeing in the assistant where two remotes would
attempt to sync with one another at the same time, and both failed pushing
the diverged git-annex branch. Then when both tried to resolve the failed
push, they each modified their git-annex branch, which again each blocked
the other from pushing into it. The result was that the git-annex
branches were perpetually diverged (despite having the same content!) and
once the assistant fell into this trap, it couldn't get out and always
had to do the slow push/fail/pull/merge/push/fail cycle.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Sync.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 630ceb053..bbe6a98b3 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -154,15 +154,15 @@ pushRemote remote branch = go =<< needpush pushBranch :: Remote -> Git.Ref -> Git.Repo -> IO Bool pushBranch remote branch g = Git.Command.runBool "push" - [ Param (Remote.name remote) - , Param (show Annex.Branch.name) - , Param refspec + [ Param $ Remote.name remote + , Param $ refspec Annex.Branch.name + , Param $ refspec branch ] g where - refspec = concat - [ show $ Git.Ref.base branch + refspec b = concat + [ show $ Git.Ref.base b , ":" - , show $ Git.Ref.base $ syncBranch branch + , show $ Git.Ref.base $ syncBranch b ] mergeAnnex :: CommandStart |