merge: Avoid creating the synced/master branch.

The branch needs to be created when merging from the remote in sync,
since we diff between it and the remote's sync branch. But git annex merge
should not be creating sync branches.
This commit is contained in:
Joey Hess 2015-07-07 15:45:41 -04:00
parent 76bc0ce2a2
commit 60fc25e9d3
3 changed files with 17 additions and 5 deletions

View file

@ -194,10 +194,10 @@ mergeLocal (Just branch) = go =<< needmerge
syncbranch = syncBranch branch syncbranch = syncBranch branch
needmerge = ifM isBareRepo needmerge = ifM isBareRepo
( return False ( return False
, do , ifM (inRepo $ Git.Ref.exists syncbranch)
unlessM (inRepo $ Git.Ref.exists syncbranch) $ ( inRepo $ Git.Branch.changed branch syncbranch
inRepo $ updateBranch syncbranch , return False
inRepo $ Git.Branch.changed branch syncbranch )
) )
go False = stop go False = stop
go True = do go True = do
@ -254,7 +254,8 @@ mergeRemote remote b = ifM isBareRepo
Nothing -> do Nothing -> do
branch <- inRepo Git.Branch.currentUnsafe branch <- inRepo Git.Branch.currentUnsafe
and <$> mapM (merge Nothing) (branchlist branch) and <$> mapM (merge Nothing) (branchlist branch)
Just thisbranch -> Just thisbranch -> do
inRepo $ updateBranch $ syncBranch thisbranch
and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b)) and <$> (mapM (merge (Just thisbranch)) =<< tomerge (branchlist b))
) )
where where

1
debian/changelog vendored
View file

@ -22,6 +22,7 @@ git-annex (5.20150618) UNRELEASED; urgency=medium
* On linux, pass --as-needed to linker to avoid linking with unused * On linux, pass --as-needed to linker to avoid linking with unused
shared libraries including libyaml. shared libraries including libyaml.
* import: Fix failure of cross-device import on Windows. * import: Fix failure of cross-device import on Windows.
* merge: Avoid creating the synced/master branch.
-- Joey Hess <id@joeyh.name> Thu, 02 Jul 2015 12:31:14 -0400 -- Joey Hess <id@joeyh.name> Thu, 02 Jul 2015 12:31:14 -0400

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="joey"
subject="""comment 5"""
date="2015-07-07T19:20:17Z"
content="""
So, I was wrong about `git annex merge` creating the synced/master branch.
There's no good reason for it to do that, so I've fixed it not to create
it.
"""]]