diff options
author | Robby Russell <robby@planetargon.com> | 2009-08-31 13:54:50 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2009-08-31 13:54:50 -0700 |
commit | a26cb28de4d095d547d774a3b3258a76f17507c3 (patch) | |
tree | a670eb5c619376787d7c2ea146fcdbc3f3e29b44 /git.zsh | |
parent | 97cf1871ca1e6822200e0ae008cbbe4c24d88a4b (diff) | |
download | zsh-a26cb28de4d095d547d774a3b3258a76f17507c3.tar.gz zsh-a26cb28de4d095d547d774a3b3258a76f17507c3.tar.bz2 zsh-a26cb28de4d095d547d774a3b3258a76f17507c3.zip |
Only calling git symbolic-ref HEAD when we are in a .git directory
Diffstat (limited to 'git.zsh')
-rw-r--r-- | git.zsh | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,9 +1,8 @@ # get the name of the branch we are on function git_prompt_info() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - branch=${ref#refs/heads/} - if [[ -d .git ]]; then + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + branch=${ref#refs/heads/} CURRENT_BRANCH="%{$fg[red]%}git:(%{$fg[green]${branch}%{$fg[red])" else CURRENT_BRANCH='' |