From f43ffd4bb2ad05a4daf6d511e398269b81b5e558 Mon Sep 17 00:00:00 2001 From: anthony sottile <103459774+asottile-sentry@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:04:45 -0500 Subject: [PATCH] ref: use `git branch --show-current` instead of sed (#2550) --- install/check-latest-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/check-latest-commit.sh b/install/check-latest-commit.sh index cf3acb2..5db9317 100644 --- a/install/check-latest-commit.sh +++ b/install/check-latest-commit.sh @@ -2,7 +2,7 @@ echo "${_group}Checking for latest commit ... " # Checks if we are on latest commit from github if it is running from master branch if [[ -d "../.git" && "${SKIP_COMMIT_CHECK:-0}" != 1 ]]; then - if [[ $(git branch | sed -n '/\* /s///p') == "master" ]]; then + if [[ $(git branch --show-current) == "master" ]]; then if [[ $(git rev-parse HEAD) != $(git ls-remote $(git rev-parse --abbrev-ref @{u} | sed 's/\// /g') | cut -f1) ]]; then echo "Seems like you are not using the latest commit from the self-hosted repository. Please pull the latest changes and try again, or suppress this check with --skip-commit-check." exit 1