mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
Merge commit '7eb07eebff9bc1297c87a04ee4d703b491bc8ca2'
This commit is contained in:
@@ -40,6 +40,13 @@ commit_timestamp() {
|
||||
git show -s --format=%ct "$rev"
|
||||
}
|
||||
|
||||
# Is the SHA1 actually present in the repo?
|
||||
# It could be it isn't, e.g. after a force push
|
||||
is_valid_commit() {
|
||||
local rev=$1
|
||||
git rev-parse --quiet --verify "$rev^{commit}" > /dev/null
|
||||
}
|
||||
|
||||
cached_revision=$(cached_image_rev)
|
||||
if [ -z "$cached_revision" ]; then
|
||||
echo ">>> No cached image found; rebuilding"
|
||||
@@ -47,6 +54,12 @@ if [ -z "$cached_revision" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! is_valid_commit "$cached_revision"; then
|
||||
echo ">>> Git commit of cached image not found in repo; rebuilding"
|
||||
rebuild
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ">>> Found cached image rev $cached_revision"
|
||||
if has_changes "$cached_revision" "$CIRCLE_SHA1" ; then
|
||||
echo ">>> Found changes, rebuilding"
|
||||
|
||||
Reference in New Issue
Block a user