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