allow adjusttreeitem to remove submodules

This commit is contained in:
Joey Hess 2021-03-12 13:19:23 -04:00
parent f2a425bd92
commit 4b57e1c0ad
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -240,10 +240,11 @@ adjustTree adjusttreeitem addtreeitems resolveaddconflict removefiles r repo =
Just CommitObject -> do
let ti = TreeItem (LsTree.file i) (LsTree.mode i) (LsTree.sha i)
v <- adjusttreeitem ti
let commit = tc $ fromMaybe ti v
go h wasmodified (commit:c) depth intree is
where
tc (TreeItem f m s) = TreeCommit f m s
case v of
Nothing -> go h True c depth intree is
Just (TreeItem f m s) ->
let commit = TreeCommit f m s
in go h wasmodified (commit:c) depth intree is
_ -> error ("unexpected object type \"" ++ decodeBS (LsTree.typeobj i) ++ "\"")
| otherwise = return (c, wasmodified, i:is)