bashrc: Change Git info functionality
This commit is contained in:
parent
e4cf3f5b90
commit
10d92e9118
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue