v6: Fix bad merge in an adjusted branch that resulted in an empty tree.
This commit is contained in:
parent
f4e2581056
commit
bfd00a0f8c
2 changed files with 10 additions and 3 deletions
|
@ -358,10 +358,16 @@ updateAdjustedBranch tomerge (origbranch, adj) mergeconfig commitmode = catchBoo
|
||||||
withTmpDirIn misctmpdir "git" $ \tmpgit -> withWorkTreeRelated tmpgit $
|
withTmpDirIn misctmpdir "git" $ \tmpgit -> withWorkTreeRelated tmpgit $
|
||||||
withemptydir tmpwt $ withWorkTree tmpwt $ do
|
withemptydir tmpwt $ withWorkTree tmpwt $ do
|
||||||
liftIO $ writeFile (tmpgit </> "HEAD") (fromRef updatedorig)
|
liftIO $ writeFile (tmpgit </> "HEAD") (fromRef updatedorig)
|
||||||
|
-- This reset makes git merge not care
|
||||||
|
-- that the work tree is empty; otherwise
|
||||||
|
-- it will think that all the files have
|
||||||
|
-- been staged for deletion, and sometimes
|
||||||
|
-- the merge includes these deletions
|
||||||
|
-- (for an unknown reason).
|
||||||
|
-- http://thread.gmane.org/gmane.comp.version-control.git/297237
|
||||||
|
inRepo $ Git.Command.run [Param "reset", Param "HEAD", Param "--quiet"]
|
||||||
showAction $ "Merging into " ++ fromRef (Git.Ref.base origbranch)
|
showAction $ "Merging into " ++ fromRef (Git.Ref.base origbranch)
|
||||||
-- The --no-ff is important; it makes git
|
merged <- inRepo (Git.Merge.merge' [] tomerge mergeconfig commitmode)
|
||||||
-- merge not care that the work tree is empty.
|
|
||||||
merged <- inRepo (Git.Merge.merge' [Param "--no-ff"] tomerge mergeconfig commitmode)
|
|
||||||
<||> (resolveMerge (Just updatedorig) tomerge True <&&> commitResolvedMerge commitmode)
|
<||> (resolveMerge (Just updatedorig) tomerge True <&&> commitResolvedMerge commitmode)
|
||||||
if merged
|
if merged
|
||||||
then do
|
then do
|
||||||
|
|
|
@ -22,6 +22,7 @@ git-annex (6.20160528) UNRELEASED; urgency=medium
|
||||||
drop content from disk before writing location log.
|
drop content from disk before writing location log.
|
||||||
* v6: Fix bad automatic merge conflict resolution between an annexed file
|
* v6: Fix bad automatic merge conflict resolution between an annexed file
|
||||||
and a directory with the same name when in an adjusted branch.
|
and a directory with the same name when in an adjusted branch.
|
||||||
|
* v6: Fix bad merge in an adjusted branch that resulted in an empty tree.
|
||||||
* Avoid a crash if getpwuid does not work, when querying the user's full
|
* Avoid a crash if getpwuid does not work, when querying the user's full
|
||||||
name.
|
name.
|
||||||
* v6: Fix bug in initialization of clone from a repo with an adjusted branch
|
* v6: Fix bug in initialization of clone from a repo with an adjusted branch
|
||||||
|
|
Loading…
Reference in a new issue