From a5505119dd24ab05ca76f1e17505555949771fd0 Mon Sep 17 00:00:00 2001 From: Lie Ryan <ryan@prezzee.com.au> Date: Tue, 6 Jul 2021 21:55:10 +1000 Subject: [PATCH] Fix workon_cwd to detect git subtree In a `git subtree` working directory, `.git` is a file containing a path to the parent git working direcotry. This change attempts to find a virtualenv for a subtree. --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index c30216f51..508f74d85 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -38,7 +38,7 @@ if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then # Get absolute path, resolving symlinks local PROJECT_ROOT="${PWD:A}" while [[ "$PROJECT_ROOT" != "/" && ! -e "$PROJECT_ROOT/.venv" \ - && ! -d "$PROJECT_ROOT/.git" ]]; do + && ! -e "$PROJECT_ROOT/.git" ]]; do PROJECT_ROOT="${PROJECT_ROOT:h}" done