We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7dee79a commit f5b6d26Copy full SHA for f5b6d26
1 file changed
util/update_scripts.sh
@@ -67,7 +67,7 @@ echo "Processing ${scr}"
67
else
68
if [[ -z "${CUR_BRANCH}" ]]; then
69
# Fetch default branch name
70
- CUR_BRANCH="$(git remote show "${CUR_REPO}" | grep "HEAD branch:" | cut -d":" -f2 | xargs)"
+ CUR_BRANCH="$(git ls-remote --symref --exit-code "${CUR_REPO}" HEAD | awk '/^ref:/ {print $2}' | sed 's|refs/heads/||')"
71
echo "Found default branch ${CUR_BRANCH}"
72
fi
73
NEW_COMMIT="$(git ls-remote --exit-code --heads --refs "${CUR_REPO}" refs/heads/"${CUR_BRANCH}" | cut -f1)"
0 commit comments