Cirrus: Tolerate missing projects when unpacking Git

pull/123/head
Jeremy Rand 3 years ago
parent 944cb39dd2
commit 40b7e1d0b8
No known key found for this signature in database
GPG Key ID: FD7550C2EB800711

@ -5,6 +5,16 @@ shopt -s failglob
for PROJECT in ./git_index/* for PROJECT in ./git_index/*
do do
PROJECT_BASE=$(basename $PROJECT) PROJECT_BASE="$(basename $PROJECT)"
mv ${PROJECT} ./git_clones/${PROJECT_BASE}/.git/index
# It's possible that the cache contains a project that was removed from the
# build sometime after the cache was saved. In such a case, unpacking it
# would result in "No such file or directory", so we just discard it
# instead.
if [[ -d "./git_clones/${PROJECT_BASE}/.git" ]]
then
mv "${PROJECT}" "./git_clones/${PROJECT_BASE}/.git/index"
else
rm "${PROJECT}"
fi
done done

Loading…
Cancel
Save