From e3d886b21e092a93a20a3e218411750aeed3e997 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 3 Jul 2013 15:11:36 +1200 Subject: More compatible branch calculation Still using some old Debian Squeeze servers --- bash/bashrc.d/prompt.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash index 67efbd70..e34d1f2a 100644 --- a/bash/bashrc.d/prompt.bash +++ b/bash/bashrc.d/prompt.bash @@ -33,9 +33,10 @@ function prompt { && return 1 $(git rev-parse --is-inside-work-tree 2>/dev/null ) \ || return 1 - branch=$(git symbolic-ref --quiet --short HEAD 2> /dev/null ) \ + branch=$(git symbolic-ref --quiet HEAD 2>/dev/null ) \ || branch=$(git rev-parse --short HEAD 2>/dev/null ) \ - || branch="(unknown)" + || branch='unknown' + branch=${branch##*/} $(git diff --quiet --ignore-submodules --cached ) \ || state=${state}+ $(git diff-files --quiet --ignore-submodules -- ) \ -- cgit v1.2.3