commit 80d038d8dc03de48f67320651b77fa5730c49d39 parent b92ceed6ce8fd41ce346ffcc2c832bd2fb46d8ba Author: Nihal Jere <nihal@nihaljere.xyz> Date: Thu, 25 Nov 2021 20:43:23 -0600 optimize a bit Diffstat:
M | git-submodule-integrate | | | 8 | +++++--- |
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/git-submodule-integrate b/git-submodule-integrate @@ -29,13 +29,15 @@ do hash=$(echo "$line" | cut -d' ' -f3 | cut -d' ' -f1) path=$(echo "$line" | cut -d' ' -f2) - git -C "$child" cat-file "$type" "$hash" | git hash-object -t "$type" -w --stdin > /dev/null + if ! git cat-file -e "$hash" + then + git -C "$child" cat-file "$type" "$hash" | git hash-object -t "$type" -w --stdin > /dev/null + fi done - git rm -r "$where" + git rm -q -r --cached "$where" git read-tree --prefix="$where" "$treehash" - git restore . git commit -C "$commit" || exit 1 finished=$(( finished + 1 ))