From 3a9239d227fa3476550c8fdb00160d5ae2e68f76 Mon Sep 17 00:00:00 2001 From: Dan Nguyen Date: Wed, 23 Sep 2015 14:32:02 -0500 Subject: [PATCH] Fix issue where _NO_REMOTE_TRACKING_ doesn't show up when there is no remote branch --- gitstatus.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitstatus.sh b/gitstatus.sh index cea824a..df90245 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -50,6 +50,10 @@ branch_line=`echo "$gitstatus" | grep "^##"` IFS="." read -ra line <<< "${branch_line/\#\# }" branch="${line[0]}" +if [[ "${#line[@]}" -eq 1 ]]; then + remote="_NO_REMOTE_TRACKING_" +fi + if [[ -z "$branch" ]]; then tag=`git describe --exact-match` if [[ -n "$tag" ]]; then