make merge commit on export that preserves the import history

This commit is contained in:
Joey Hess 2019-05-01 13:13:00 -04:00
parent d1c283b691
commit 2bd0e07ed8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 47 additions and 8 deletions

View file

@ -31,6 +31,7 @@ import Annex.Link
import Annex.LockFile
import Annex.Content
import Annex.Export
import Annex.RemoteTrackingBranch
import Command
import Backend
import Config
@ -188,12 +189,9 @@ buildImportCommit' importcommitconfig mtrackingcommit imported@(History ti _) =
-- history as exported, and git merge will understand that
-- the history is connected.
| otherwise = do
ci <- mkcommits imported
let parents =
[ trackingcommit
, ci
]
Just <$> mkcommit parents ti
importedcommit <- mkcommits imported
Just <$> makeRemoteTrackingBranchMergeCommit'
trackingcommit importedcommit ti
where
h'@(History t s) = mapHistory historyCommitTree h