aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-01 23:42:02 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-01 23:42:02 +0300
commit2d6a5f84bbc71392e88de1f705d93ad2d737300c (patch)
treea205d4abf8f52b3c6f08c10b51f400d4bebe6772
parent41d741fb1f74c8ab5d556f043d351e94f162384a (diff)
pull upstream changes from gitstatus
-rw-r--r--gitstatus/gitstatus.plugin.zsh9
1 files changed, 5 insertions, 4 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 44b0e7a3..5cae2fef 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -256,9 +256,10 @@ function gitstatus_start() {
}
zle -F $resp_fd _gitstatus_process_response_${name}
- typeset -g GITSTATUS_DAEMON_LOG_${name}=/dev/null
- [[ ${GITSTATUS_ENABLE_LOGGING:-0} != 1 ]] ||
- typeset GITSTATUS_DAEMON_LOG_${name}=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX)
+ [[ ${GITSTATUS_ENABLE_LOGGING:-0} == 1 ]] &&
+ log_file=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX) ||
+ log_file=/dev/null
+ typeset -g GITSTATUS_DAEMON_LOG_${name}=$log_file
local -i threads=${GITSTATUS_NUM_THREADS:-0}
(( threads > 0)) || {
@@ -277,7 +278,7 @@ function gitstatus_start() {
--num-threads=$threads \
--dirty-max-index-size=$max_dirty
echo -nE $'bye\x1f0\x1e'
- " <&$req_fd >&$resp_fd 2>$GITSTATUS_DAEMON_LOG_${name} 3<$lock_file &!
+ " <&$req_fd >&$resp_fd 2>$log_file 3<$lock_file &!
daemon_pid=$!
command rm -f $lock_file