From b6e518399ccc9abe480361154829d5a1651275ba Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 9 Dec 2019 13:54:38 -0800 Subject: [PATCH] devops: properly extract remote url while running export checks Turns out `git rmeote get-url` resolves the `insteadOf` substitutions and ends up with a different URL. This patch bypasses these substitutions to properly validate remote url. --- browser_patches/export.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browser_patches/export.sh b/browser_patches/export.sh index af1f97775a..e08e29c2eb 100755 --- a/browser_patches/export.sh +++ b/browser_patches/export.sh @@ -74,8 +74,9 @@ cd $CHECKOUT_PATH # Setting up |$REMOTE_BROWSER_UPSTREAM| remote and fetch the $BASE_BRANCH if git remote get-url $REMOTE_BROWSER_UPSTREAM >/dev/null; then - if ! [[ $(git remote get-url $REMOTE_BROWSER_UPSTREAM) == "$REMOTE_URL" ]]; then - echo "ERROR: remote $REMOTE_BROWSER_UPSTREAM is not pointng to '$REMOTE_URL'! run `prepare_checkout.sh` first" + if ! [[ $(git config --get remote.$REMOTE_BROWSER_UPSTREAM.url || echo "") == "$REMOTE_URL" ]]; then + echo "ERROR: remote $REMOTE_BROWSER_UPSTREAM is not pointing to '$REMOTE_URL'! run `prepare_checkout.sh` first" + exit 1 fi else echo "ERROR: checkout does not have $REMOTE_BROWSER_UPSTREAM; run `prepare_checkout.sh` first"