git-submodule-integrate

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/git-submodule-integrate
Log | Files | Refs | README | LICENSE

commit 909cae4969e290385a71ea825f9d5ae8e16de34c
parent 8ae7194e6c19a90890ad2aedcf104a497d39430c
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Tue, 11 Jan 2022 11:45:03 -0600

check if object is already in parent repository before copying

Diffstat:
Mgit-submodule-integrate | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/git-submodule-integrate b/git-submodule-integrate @@ -36,7 +36,10 @@ do type=$(git -C "$child" cat-file -t "$newhash") [ "$type" = "commit" ] && continue - git -C "$child" cat-file "$type" "$newhash" | git hash-object -t "$type" -w --stdin > /dev/null + if ! git cat-file -e "$newhash" + then + git -C "$child" cat-file "$type" "$newhash" | git hash-object -t "$type" -w --stdin > /dev/null + fi done git rm -q -r --cached "$where"