Merge #123: Cirrus: Tolerate missing projects when unpacking Git

40b7e1d Cirrus: Tolerate missing projects when unpacking Git (Jeremy Rand)

Pull request description:
pull/59/head
Jeremy Rand 3 years ago
commit f284c9952e
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/*
do
PROJECT_BASE=$(basename $PROJECT)
mv ${PROJECT} ./git_clones/${PROJECT_BASE}/.git/index
PROJECT_BASE="$(basename $PROJECT)"
# 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

Loading…
Cancel
Save