rspec/ci/fetch_branches.sh

8 lines
243 B
Bash
Raw Permalink Normal View History

#!/bin/bash
set -euo pipefail
# When neither BASE_BRANCH nor DEFAULT_BRANCH are defined, fall back to "master".
BRANCH="${BASE_BRANCH:-${DEFAULT_BRANCH:-master}}"
git fetch --force origin "refs/heads/${BRANCH}:refs/remotes/origin/${BRANCH}"