Add conditional check for commit presence before updating dependencies

This commit is contained in:
Théophile Diot 2024-01-12 13:58:40 +00:00
parent 9c2e7a0e98
commit 9eee9523b9
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -52,8 +52,12 @@ do
post="yes"
else
echo "⚠️ Skipping clone of $url because target directory is already present"
echo " Updating ${name} from $url at commit/version $commit"
do_and_check_cmd git subtree pull --prefix "src/deps/src/$id" "$url" "$commit" --squash
# Check if the commit is already present
if [ "$(git rev-parse "$commit" 2>/dev/null)" != "$commit" ] ; then
echo " Updating ${name} from $url at commit/version $commit"
do_and_check_cmd git subtree pull --prefix "src/deps/src/$id" "$url" "$commit" --squash
post="yes"
fi
fi
if [ -d "src/deps/src/$id/.git" ] ; then