From 6ebe707670d84e1815bfe440008dba1eca82973a Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Fri, 6 Oct 2023 17:55:12 -0700 Subject: [PATCH] fix git branch checks --- chk_tree | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chk_tree b/chk_tree index 5911af3..b0353eb 100755 --- a/chk_tree +++ b/chk_tree @@ -166,7 +166,7 @@ if [[ -d .git ]]; then # GIT_MASTER=$(git rev-list --count 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 git status master EXIT_CODE=16 @@ -177,7 +177,7 @@ if [[ -d .git ]]; then # GIT_HEAD=$(git rev-list --count 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 git status HEAD EXIT_CODE=17