summaryrefslogtreecommitdiff
path: root/gitstatus/gitstatus.plugin.zsh
diff options
context:
space:
mode:
authorRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-01-04 14:14:19 +0300
committerRoman Perepelitsa <roman.perepelitsa@gmail.com>2022-01-04 14:14:19 +0300
commit2079d8ecbe68368d1114b332169778512b62e579 (patch)
tree56a5964d4edf4cbf56c8d5ece5e725aa60125b7e /gitstatus/gitstatus.plugin.zsh
parent3d3b24c419a3b35b632e96fe9de34641e06f8521 (diff)
parentc8160f29543a2f57ae7149103deefa029fd4e861 (diff)
Merge commit 'c8160f29543a2f57ae7149103deefa029fd4e861'
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-rw-r--r--gitstatus/gitstatus.plugin.zsh16
1 files changed, 14 insertions, 2 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index cef78974..181e756a 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -185,9 +185,21 @@ function gitstatus_query"${1:-}"() {
(( _GITSTATUS_STATE_$name == 2 )) || return
if [[ -z $GIT_DIR ]]; then
- [[ $dir == /* ]] || dir=${(%):-%/}/$dir
+ if [[ $dir != /* ]]; then
+ if [[ $PWD == /* && $PWD -ef . ]]; then
+ dir=$PWD/$dir
+ else
+ dir=${dir:a}
+ fi
+ fi
else
- [[ $GIT_DIR == /* ]] && dir=:$GIT_DIR || dir=:${(%):-%/}/$GIT_DIR
+ if [[ $GIT_DIR == /* ]]; then
+ dir=:$GIT_DIR
+ elif [[ $PWD == /* && $PWD -ef . ]]; then
+ dir=:$PWD/$GIT_DIR
+ else
+ dir=:${GIT_DIR:a}
+ fi
fi
if [[ $dir != (|:)/* ]]; then