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.
This commit is contained in:
Andrey Lushnikov 2019-12-09 13:54:38 -08:00
Родитель c323a3e50b
Коммит b6e518399c
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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"