0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

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.
This commit is contained in:
Lie Ryan 2021-07-06 21:55:10 +10:00
parent e32d4b1e19
commit a5505119dd
No known key found for this signature in database
GPG key ID: 67ACC735F11F4E5B

View file

@ -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