commit 3693a4f459ef6844caaa09bfb20da0eebb0f3585 parent be42d928a9d09d0138965a148cd378f22cf0ea1c Author: Nihal Jere <nihal@nihaljere.xyz> Date: Thu, 25 Nov 2021 19:43:05 -0600 use git-rm and git-read-tree so that deleted files are handled Diffstat:
M | git-submodule-integrate | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/git-submodule-integrate b/git-submodule-integrate @@ -27,8 +27,11 @@ do path=$(echo "$line" | cut -d' ' -f2) git -C "$child" cat-file "$type" "$hash" | git hash-object -t "$type" -w --stdin > /dev/null - [ "$type" != "tree" ] && git update-index --add --cacheinfo "$mode,$hash,$where/$path" > /dev/null done - git commit -C "$commit" + git rm -r "$where" + git read-tree --prefix="$where" "$treehash" + + git restore . + git commit -C "$commit" || exit 1 done