mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 12:48:01 +00:00
Only calling git symbolic-ref HEAD when we are in a .git directory
This commit is contained in:
parent
fb21e5ddb7
commit
71bc81b14a
5
git.zsh
5
git.zsh
@ -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=''
|
||||
|
Loading…
Reference in New Issue
Block a user