From 884fa4a5ca5fe5d9e26551d177a67bef6daa7410 Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Sun, 5 Nov 2023 05:46:38 -0800 Subject: [PATCH] Fix minor ShellCheck violations --- git-prompt-help.sh | 14 +++++++------- gitprompt.sh | 2 +- gitstatus.sh | 3 ++- gitstatus_pre-1.7.10.sh | 3 +-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/git-prompt-help.sh b/git-prompt-help.sh index 6f2f8f83..3524cec5 100755 --- a/git-prompt-help.sh +++ b/git-prompt-help.sh @@ -52,18 +52,18 @@ git_prompt_examples() { cat < [http://github.com/aks] # helper functions -count_lines() { echo "${1}" | egrep -c "^${2}" ; } +count_lines() { echo "${1}" | grep -Ec "^${2}" ; } all_lines() { echo "${1}" | grep -v "^$" | wc -l ; } if [[ -z "${__GIT_PROMPT_DIR-}" ]]; then @@ -95,7 +95,6 @@ else # detect if the local branch have a remote tracking branch upstream=$( git rev-parse --abbrev-ref "${branch}"@{upstream} 2>&1 ) - if [[ "${?}" == 0 ]]; then # get the revision list, and count the leading "<" and ">" revgit=$( git rev-list --left-right "${remote_ref}...HEAD" 2>/dev/null )