From 750425d8417478f098b04b8544ddb26d7d70d633 Mon Sep 17 00:00:00 2001 From: oGre Date: Thu, 24 Sep 2015 08:33:06 +0200 Subject: [PATCH 1/2] Changed all backticks to --- gitstatus.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gitstatus.sh b/gitstatus.sh index 9cff1c4..b228b5a 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -15,7 +15,7 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then __GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )" fi -gitstatus=`LC_ALL=C git status --porcelain --branch` +gitstatus=$( LC_ALL=C git status --porcelain --branch ) # if the status is fatal, exit now [[ "$?" -ne 0 ]] && exit 0 @@ -38,9 +38,9 @@ done <<< "$gitstatus" if [[ "$__GIT_PROMPT_IGNORE_STASH" = "1" ]]; then num_stashed=0 else - stash_file="`git rev-parse --git-dir`/logs/refs/stash" + stash_file="$( git rev-parse --git-dir )/logs/refs/stash" if [[ -e "${stash_file}" ]]; then - num_stashed=`wc -l "${stash_file}" | cut -d' ' -f1` + num_stashed=$( wc -l "${stash_file}" | cut -d' ' -f1 ) else num_stashed=0 fi @@ -62,17 +62,17 @@ if [[ "${#line[@]}" -eq 1 ]]; then fi if [[ -z "$branch" ]]; then - tag=`git describe --exact-match` + tag=$( git describe --exact-match ) if [[ -n "$tag" ]]; then branch="$tag" else - branch="_PREHASH_`git rev-parse --short HEAD`" + branch="_PREHASH_$( git rev-parse --short HEAD )" fi elif [[ "$branch" == *"Initial commit on"* ]]; then IFS=" " read -ra branch_line <<< "$branch" branch=${branch_line[-1]} elif [[ "$branch" == *"no branch"* ]]; then - branch="_PREHASH_`git rev-parse --short HEAD`" + branch="_PREHASH_$( git rev-parse --short HEAD )" else IFS="[,]" read -ra remote_line <<< "${line[3]}" for rline in "${remote_line[@]}"; do From 87c66ea8d1d65b91519c5f032544321e064bcfd4 Mon Sep 17 00:00:00 2001 From: oGre Date: Thu, 24 Sep 2015 17:28:20 +0200 Subject: [PATCH 2/2] Missed one --- gitstatus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.sh b/gitstatus.sh index b228b5a..a83e91b 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -53,7 +53,7 @@ fi remote= -branch_line=`echo "$gitstatus" | grep "^##"` +branch_line=$( echo "$gitstatus" | grep "^##" ) IFS="." read -ra line <<< "${branch_line/\#\# }" branch="${line[0]}"