]> dgit.raspbian.org Git - git-annex.git/commitdiff
adjust: Propagate submodule changes back to original branch
authorKyle Meyer <kyle@kyleam.com>
Wed, 18 Mar 2020 02:16:06 +0000 (22:16 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 26 Mar 2020 19:16:08 +0000 (15:16 -0400)
When the recorded submodule commit changes on an adjusted branch, the
change is carried in the function that reverseAdjustedCommit passes
for adjustTree's adjusttreeitem parameter.  Update the CommitObject
handling in adjustTree to consider adjusttreeitem so that a submodule
change is synced back.

Git/Tree.hs

index da05a3fa5d8f6571e5eaa85e10b6d3912049fe09..9627ae969041a1838350e7bb2e31a6ceab5724a3 100644 (file)
@@ -237,8 +237,12 @@ adjustTree adjusttreeitem addtreeitems resolveaddconflict removefiles r repo =
                                let !modified' = modified || slmodified || wasmodified
                                go h modified' (subtree : c) depth intree is'
                        Just CommitObject -> do
-                               let ti = TreeCommit (LsTree.file i) (LsTree.mode i) (LsTree.sha i)
-                               go h wasmodified (ti:c) depth intree is
+                               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
                        _ -> error ("unexpected object type \"" ++ decodeBS (LsTree.typeobj i) ++ "\"")
                | otherwise = return (c, wasmodified, i:is)