adjustTree: Consider submodule deletions
authorKyle Meyer <kyle@kyleam.com>
Thu, 7 Jan 2021 00:16:30 +0000 (19:16 -0500)
committerJoey Hess <joeyh@joeyh.name>
Thu, 7 Jan 2021 17:43:09 +0000 (13:43 -0400)
In addition to regular file deletions, the removefiles argument passed
to adjustTree may contain removed submodules.  When making the new
tree, filter these out in the same way that is done for regular files
so that the deletion is propagated.

Git/Tree.hs

index 491314fff59f234c07481434179505634336bcff..d5ac59ea74cd7114e5de40c6c7da26f6e298749b 100644 (file)
@@ -259,6 +259,7 @@ adjustTree adjusttreeitem addtreeitems resolveaddconflict removefiles r repo =
 
        removeset = S.fromList $ map (normalise . gitPath) removefiles
        removed (TreeBlob f _ _) = S.member (normalise (gitPath f)) removeset
+       removed (TreeCommit f _ _) = S.member (normalise (gitPath f)) removeset
        removed _ = False
 
        addoldnew [] new = new