diff --git a/misc/scripts/prepare-db-upgrade.sh b/misc/scripts/prepare-db-upgrade.sh index 14aa030c25e4..8a8b32d17401 100755 --- a/misc/scripts/prepare-db-upgrade.sh +++ b/misc/scripts/prepare-db-upgrade.sh @@ -30,7 +30,10 @@ EOF exit "${exit_code}" } -prev_hash="origin/main" +# default for prev_hash: the main branch of the remote for 'github/codeql'. +# This works out as a dynamic lookup of the hash of the file in the main branch +# of the repo. +prev_hash=$(git remote -v | grep 'github/codeql\.git (fetch)$' | cut -f1)/main while [ $# -gt 0 ]; do case "$1" in