aboutsummaryrefslogtreecommitdiff
path: root/gitstatus
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-07 19:20:29 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-07 19:20:29 +0300
commit305b56a5e3c54e6f616d3cac9d1ca6fbc3e55233 (patch)
tree23ab202796ea73b9eff423c148d5734ac077cbd0 /gitstatus
parent93230ae6ec92add5f86bf6131c970a3c04f232cd (diff)
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus')
-rw-r--r--gitstatus/gitstatus.plugin.zsh9
1 files changed, 6 insertions, 3 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 48fb3dd3..7faa196c 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -63,7 +63,8 @@ zmodload zsh/datetime zsh/system
#
## Usage: gitstatus_query [OPTION]... NAME
#
-# -d STR Directory to query. Defaults to ${${GIT_DIR:-$PWD}:a}. Must be absolute.
+# -d STR Directory to query. Must be absolute. Defaults to $GIT_DIR or the current
+# directory if GIT_DIR is not set.
# -c STR Callback function to call once the results are available. Called only after
# gitstatus_query returns 0 with VCS_STATUS_RESULT=tout.
# -t FLOAT Timeout in seconds. Will block for at most this long. If no results are
@@ -126,8 +127,8 @@ function gitstatus_query() {
setopt err_return no_unset
local opt
- local dir=${${GIT_DIR:-$PWD}:a}
- local callback=''
+ local dir=${GIT_DIR:-}
+ local callback
local -F timeout=-1
local no_diff=0
while true; do
@@ -150,6 +151,8 @@ function gitstatus_query() {
local client_pid_var=_GITSTATUS_CLIENT_PID_${name}
[[ ${(P)client_pid_var} == $$ ]]
+ [[ $dir == /* ]] || dir=${(%):-%/}/$dir
+
local req_fd_var=_GITSTATUS_REQ_FD_${name}
local -i req_fd=${(P)req_fd_var}
local -r req_id="$EPOCHREALTIME"