Skip to content

Commit f43ffd4

Browse files
ref: use git branch --show-current instead of sed (#2550)
1 parent 186aa6e commit f43ffd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

install/check-latest-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ echo "${_group}Checking for latest commit ... "
22

33
# Checks if we are on latest commit from github if it is running from master branch
44
if [[ -d "../.git" && "${SKIP_COMMIT_CHECK:-0}" != 1 ]]; then
5-
if [[ $(git branch | sed -n '/\* /s///p') == "master" ]]; then
5+
if [[ $(git branch --show-current) == "master" ]]; then
66
if [[ $(git rev-parse HEAD) != $(git ls-remote $(git rev-parse --abbrev-ref @{u} | sed 's/\// /g') | cut -f1) ]]; then
77
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."
88
exit 1

0 commit comments

Comments
 (0)