From 18007bc022b06e542dfa5362377e70a6775ce4ce Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sat, 28 Dec 2019 21:57:17 +0100 Subject: [PATCH] Fix git (HEAD detached at ...) bash prompt --- .functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.functions b/.functions index 4b66cd3..d91a69b 100644 --- a/.functions +++ b/.functions @@ -4,7 +4,7 @@ iploc () { curl -s http://ip-api.com/json/"$1"|tr , '\n'|sed 's/[\"{}]//g'; } function parse_branch { scmexe=${1:-git} - $scmexe branch 2> /dev/null | awk '/^*/{print "("$2")"}' + $scmexe branch 2> /dev/null | awk '/^*/{$1="";sub(/^ /, "");print "("$0")"}' } yell() { echo "$0: $*" >&2; }