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
|
@ -15,6 +15,7 @@ module Git.LsTree (
|
|||
lsTreeParams,
|
||||
lsTreeFiles,
|
||||
parseLsTree,
|
||||
formatLsTree,
|
||||
) where
|
||||
|
||||
import Common
|
||||
|
@ -90,3 +91,12 @@ parseLsTree l = TreeItem
|
|||
!f = drop 1 past_s
|
||||
!smode = fst $ Prelude.head $ readOct m
|
||||
!sfile = asTopFilePath $ Git.Filename.decode f
|
||||
|
||||
{- Inverse of parseLsTree -}
|
||||
formatLsTree :: TreeItem -> String
|
||||
formatLsTree ti = unwords
|
||||
[ showOct (mode ti) ""
|
||||
, typeobj ti
|
||||
, fromRef (sha ti)
|
||||
, getTopFilePath (file ti)
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue