7fbbf28e6e37e604c7821a24993d32a478d857f8
- Author
- ncanceill <nicolas.canceill@ens-cachan.org>
- Committer
- ncanceill <nicolas.canceill@ens-cachan.org>
- Date
Message
return 0 when not a git repo
before, 128 was returned, which could display an error,
but out of a git repo this should exit silently
fixes #2226
Diff
1diff --git a/lib/git.zsh b/lib/git.zsh
2index 305a77aff087716a9148ea0b2aa40012e989109e..df77227216b91a2af40ad5589964a085ea1804bb 100644
3--- a/lib/git.zsh
4+++ b/lib/git.zsh
5@@ -2,7 +2,7 @@
6 function git_prompt_info() {
7 if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
8 ref=$(command git symbolic-ref HEAD 2> /dev/null) || \
9- ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
10+ ref=$(command git rev-parse --short HEAD 2> /dev/null) || return 0
11 echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
12 fi
13 }