formatLsTree did not use a tab where git does

Fixed that, and made parserLsTree accept the space as well as tab.

Fixes a reversion that made import of a tree from a special remote result in
a merge that deleted files that were not preferred content of that special
remote.
This commit is contained in:
Joey Hess 2021-01-28 12:36:37 -04:00
parent 3b8fcefb45
commit e3224ff77d
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 74 additions and 9 deletions

View file

@ -197,10 +197,12 @@ logExportExcluded u a = do
getExportExcluded :: UUID -> Annex [Git.Tree.TreeItem]
getExportExcluded u = do
logf <- fromRepo $ gitAnnexExportExcludeLog u
liftIO $ catchDefaultIO [] $ parser
liftIO $ catchDefaultIO [] $ exportExcludedParser
<$> L.readFile (fromRawFilePath logf)
where
parser = map Git.Tree.lsTreeItemToTreeItem
. rights
. map Git.LsTree.parseLsTree
. L.split (fromIntegral $ ord '\n')
exportExcludedParser :: L.ByteString -> [Git.Tree.TreeItem]
exportExcludedParser = map Git.Tree.lsTreeItemToTreeItem
. rights
. map Git.LsTree.parseLsTree
. L.split (fromIntegral $ ord '\n')