From 1603b30f710eb7ef69aa336dbf1b64eab352cb4f Mon Sep 17 00:00:00 2001 From: Martin Gondermann Date: Sun, 27 Sep 2015 23:11:18 +0200 Subject: [PATCH] Fixes error on freshly initialized repository --- gitstatus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitstatus.sh b/gitstatus.sh index d03f197..5416fec 100755 --- a/gitstatus.sh +++ b/gitstatus.sh @@ -56,7 +56,7 @@ remote= if [[ "$branch" == *"Initial commit on"* ]]; then IFS=" " read -ra branch_line <<< "$branch" - branch=${branch_line[-1]} + branch="${branch_line[3]}" remote="_NO_REMOTE_TRACKING_" elif [[ "$branch" == *"no branch"* ]]; then tag=$( git describe --exact-match )