Skip to content

Commit 89b085d

Browse files
committed
Always use external git; _agkozak_debug_print
1 parent 3c235bc commit 89b085d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

agkozak-zsh-prompt.plugin.zsh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ _agkozak_prompt_dirtrim() {
197197
############################################################
198198
_agkozak_branch_status() {
199199
local ref branch
200-
ref=$(git symbolic-ref --quiet HEAD 2> /dev/null)
200+
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
201201
case $? in # See what the exit code is.
202202
0) ;; # $ref contains the name of a checked-out branch.
203203
128) return ;; # No Git repository here.
204204
# Otherwise, see if HEAD is in detached state.
205-
*) ref=$(git rev-parse --short HEAD 2> /dev/null) || return ;;
205+
*) ref=$(command git rev-parse --short HEAD 2> /dev/null) || return ;;
206206
esac
207207
branch=${ref#refs/heads/}
208208
[[ -n $branch ]] && printf ' (%s%s)' "$branch" "$(_agkozak_branch_changes)"
@@ -418,7 +418,7 @@ _agkozak_async_init() {
418418
_agkozak_usr1_async_worker &!
419419
typeset -g AGKOZAK_USR1_ASYNC_WORKER=$!
420420
else
421-
echo 'agkozak-zsh-prompt: TRAPUSR1 has been redefined. Disabling asynchronous mode.' >&2
421+
_agkozak_debug_print 'TRAPUSR1 has been redefined. Disabling asynchronous mode.'
422422
typeset -g AGKOZAK_ASYNC_METHOD='none'
423423
psvar[3]="$(_agkozak_branch_status)"
424424
fi
@@ -656,7 +656,6 @@ _agkozak_precmd() {
656656
}
657657

658658
# Clean up environment
659-
unfunction _agkozak_load_async_lib _agkozak_has_usr1 \
660-
_agkozak_is_ssh
659+
unfunction _agkozak_load_async_lib _agkozak_has_usr1 _agkozak_is_ssh
661660

662661
# vim: ts=2:et:sts=2:sw=2:

0 commit comments

Comments
 (0)