From e2761ab1784145e286ce51297071ce2a85ca0d19 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 7 Mar 2008 01:09:26 +0100 Subject: Better git status/colors codes managment. --- 01_Functions.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index aa96dea..809d85a 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -47,7 +47,7 @@ get_git_branch () { local my_git_branch - [ "$(git-ls-files . 2>&- | head -n 1)" == "" ] && return + [ "$( ( git-ls-tree HEAD . 2>&- ; git-ls-files . 2>&- ) | head -n 1)" == "" ] && return # Get current working GIT branch my_git_branch="$(git-branch 2>&- | grep -E '^\* ' | cut -c3-)" @@ -75,13 +75,13 @@ get_git_status () if ( echo ${(s:/:)PWD} | grep "\.\" >/dev/null ) then - my_git_status="$color[red];$color[bold]" + my_git_status="$COLOR_GIT_MANAGMENT" elif [ "$(git-diff --cached 2>&- | grep '^diff ')" != "" ] ; then - my_git_status="$color[yellow];$color[bold]" + my_git_status="$COLOR_GIT_CACHED" elif [ "$(git-ls-files -m 2>&-)" != "" ] ; then - my_git_status="$color[green];$color[bold]" + my_git_status="$COLOR_GIT_NOT_UP_TO_DATE" else - my_git_status="$color[blue]" + my_git_status="$COLOR_GIT_UP_TO_DATE" fi echo $my_git_status -- cgit v1.2.3