aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2019-03-27 12:13:25 +0300
committerGitHub <noreply@github.com>2019-03-27 12:13:25 +0300
commitd14ae7eafd8eeaa830b8578e00d1c3d03f000cce (patch)
tree88afbf61fed643de5a6e558afe8e9c2b6a70ff46
parent5bd80d88f116c2b8cc6c94c327db1c790b687a3e (diff)
parent20de3ac8fd2ae886bc33e0760cc92a388a1ade1f (diff)
Merge pull request #43 from alerque/master
Obey GIT_DIR if set for vcsh compatability
-rwxr-xr-xpowerlevel9k.zsh-theme8
1 files changed, 4 insertions, 4 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 48c393b7..5e6ff170 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1648,7 +1648,7 @@ function _p9k_vcs_style() {
function _p9k_vcs_render() {
if [[ -v _P9K_NEXT_VCS_DIR ]]; then
local -a msg
- local dir=$PWD
+ local dir=${${GIT_DIR:a}:-$PWD}
while true; do
msg=("${(@0)${_P9K_LAST_GIT_PROMPT[$dir]}}")
[[ $#msg != 0 || $dir == / ]] && break
@@ -1832,9 +1832,9 @@ function _p9k_vcs_gitstatus() {
[[ $POWERLEVEL9K_DISABLE_GITSTATUS == true ]] && return 1
if [[ $_P9K_REFRESH_REASON == precmd ]]; then
if [[ -v _P9K_NEXT_VCS_DIR ]]; then
- typeset -gH _P9K_NEXT_VCS_DIR=$PWD
+ typeset -gH _P9K_NEXT_VCS_DIR=${${GIT_DIR:a}:-$PWD}
else
- local dir=$PWD
+ local dir=${${GIT_DIR:a}:-$PWD}
local -F timeout=$POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS
while true; do
case "$_P9K_GIT_SLOW[$dir]" in
@@ -1844,7 +1844,7 @@ function _p9k_vcs_gitstatus() {
esac
done
typeset -gFH _P9K_GITSTATUS_START_TIME=$EPOCHREALTIME
- gitstatus_query -t $timeout -c _p9k_vcs_resume POWERLEVEL9K || return 1
+ gitstatus_query -d ${${GIT_DIR:a}:-$PWD} -t $timeout -c _p9k_vcs_resume POWERLEVEL9K || return 1
[[ $VCS_STATUS_RESULT == tout ]] && typeset -gH _P9K_NEXT_VCS_DIR=""
fi
fi