adjust: Propagate submodule changes back to original branch

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.
This commit is contained in:
Kyle Meyer 2020-03-17 22:16:06 -04:00 committed by Joey Hess
parent 78977ce417
commit 376e69ec65
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View 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)