fix git branch checks

This commit is contained in:
Landon Curt Noll
2023-10-06 17:55:12 -07:00
parent 885db22315
commit 6ebe707670

View File

@@ -166,7 +166,7 @@ if [[ -d .git ]]; then
# #
GIT_MASTER=$(git rev-list --count master) GIT_MASTER=$(git rev-list --count master)
GIT_ORIGIN_MASTER=$(git rev-list --count origin/master) GIT_ORIGIN_MASTER=$(git rev-list --count origin/master)
if [[ $GIT_MASTER == $GIT_ORIGIN_MASTER ]]; then if [[ $GIT_MASTER -ne $GIT_ORIGIN_MASTER ]]; then
echo "$0: ERROR: master branch is ahead of origin/master" 1>&2 echo "$0: ERROR: master branch is ahead of origin/master" 1>&2
git status master git status master
EXIT_CODE=16 EXIT_CODE=16
@@ -177,7 +177,7 @@ if [[ -d .git ]]; then
# #
GIT_HEAD=$(git rev-list --count HEAD) GIT_HEAD=$(git rev-list --count HEAD)
GIT_ORIGIN_HEAD=$(git rev-list --count origin/HEAD) GIT_ORIGIN_HEAD=$(git rev-list --count origin/HEAD)
if [[ $GIT_HEAD == $GIT_ORIGIN_HEAD ]]; then if [[ $GIT_HEAD -ne $GIT_ORIGIN_HEAD ]]; then
echo "$0: ERROR: HEAD is ahead of origin/HEAD" 1>&2 echo "$0: ERROR: HEAD is ahead of origin/HEAD" 1>&2
git status HEAD git status HEAD
EXIT_CODE=17 EXIT_CODE=17