bashrc: Change Git info functionality

This commit is contained in:
Bill Niblock 2017-08-29 12:43:31 -04:00
parent e4cf3f5b90
commit 10d92e9118

View file

@ -39,8 +39,7 @@ function show_git_info(){
local results=""
type git >/dev/null 2>&1
if [[ $? == 0 ]] ; then
local bn=$(git branch 2> /dev/null |\
awk '{ print $2; }')
local bn=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n')
if [[ -n "$bn" ]] ; then
git diff-index --quiet HEAD --
if [[ $? == 0 ]] ; then