summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-02-27 14:49:56 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-02-27 14:49:56 -0400
commitd65d777cd82dcf6f30ef5b1784f1461c5e8bbdcc (patch)
tree2e89faf2ad40632588b0a6879edc160029589757 /Command
parentd42492919535088c576d0f70799d282e56a1df5f (diff)
sync: As well as the synced/git-annex push, attempt a git-annex:git-annex push, as long as the remote branch is an ancestor of the local branch, to better support bare git repos.
See my comment in the bug report for analysis; basically this is safe because it's a non-forced push, so won't lose history. Even if it was a forced push or somehow races, things will eventually become consistent and no git-annex branch info will be lost. (This used to be done, but it forgot to do it since version 4.20130909.)
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 16932b87c..b69b9a020 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -315,7 +315,9 @@ pushBranch remote branch g = tryIO (directpush g) `after` syncpush g
, refspec branch
]
directpush = Git.Command.runQuiet $ pushparams
- [Git.fromRef $ Git.Ref.base $ fromDirectBranch branch]
+ [ Git.fromRef $ Git.Ref.base $ Annex.Branch.name
+ , Git.fromRef $ Git.Ref.base $ fromDirectBranch branch
+ ]
pushparams branches =
[ Param "push"
, Param $ Remote.name remote