add back non-preferred files to imported tree
Prevents merging the import from deleting the non-preferred files from the branch it's merged into. adjustTree previously appended the new list of items to the old, which could result in it generating a tree with multiple files with the same name. That is not good and confuses some parts of git. Gave it a function to resolve such conflicts. That allowed dealing with the problem of what happens when the import contains some files (or subtrees) with the same name as files that were filtered out of the export. The files from the import win.
This commit is contained in:
parent
7d177b78e4
commit
97fd9da6e7
9 changed files with 185 additions and 47 deletions
|
@ -265,7 +265,12 @@ adjustCommit adj basis = do
|
|||
adjustTree :: Adjustment -> BasisBranch -> Annex Sha
|
||||
adjustTree adj (BasisBranch basis) = do
|
||||
let toadj = adjustTreeItem adj
|
||||
treesha <- Git.Tree.adjustTree toadj [] [] basis =<< Annex.gitRepo
|
||||
treesha <- Git.Tree.adjustTree
|
||||
toadj
|
||||
[]
|
||||
(\_old new -> new)
|
||||
[]
|
||||
basis =<< Annex.gitRepo
|
||||
return treesha
|
||||
|
||||
type CommitsPrevented = Git.LockFile.LockHandle
|
||||
|
@ -544,6 +549,7 @@ reverseAdjustedTree basis adj csha = do
|
|||
treesha <- Git.Tree.adjustTree
|
||||
(propchanges changes)
|
||||
adds'
|
||||
(\_old new -> new)
|
||||
(map Git.DiffTree.file removes)
|
||||
basis
|
||||
=<< Annex.gitRepo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue