From 0d2583f0d36f1f44bcac37a5f13f124fc5b53c96 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 16 May 2022 10:32:22 -0600 Subject: [PATCH] devops: fix prepare_checkout script (#14198) Instead of checking repository for the existance of a commit sha, we should make sure that our remote branch has the commit. Otherwise, the `export.sh` script later on would not work! --- browser_patches/prepare_checkout.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser_patches/prepare_checkout.sh b/browser_patches/prepare_checkout.sh index 8d561f2a9f..648c0b7b3a 100755 --- a/browser_patches/prepare_checkout.sh +++ b/browser_patches/prepare_checkout.sh @@ -189,8 +189,8 @@ else git remote rename origin $REMOTE_BROWSER_UPSTREAM fi -# Check if our checkout contains BASE_REVISION. -if ! git cat-file -e "$BASE_REVISION"^{commit} 2>/dev/null; then +# if our remote branch does not contains "BASE_REVISION" - then fetch more stuff. +if [[ -z $(git branch -r --contains "${BASE_REVISION}" --list "${REMOTE_BROWSER_UPSTREAM}/${BASE_BRANCH}") ]]; then # Detach git head so that we can fetch into branch. git checkout --detach >/dev/null 2>/dev/null