diff --git a/test/test_enter.py b/test/test_enter.py index 106eb5c..d97ac2f 100644 --- a/test/test_enter.py +++ b/test/test_enter.py @@ -44,6 +44,7 @@ def test_enter(runner, yadm_y, paths, shell, success): assert 'does not refer to an executable' in run.out if 'env' in shell: assert f'GIT_DIR={paths.repo}' in run.out + assert f'GIT_WORK_TREE={paths.work}' in run.out assert f'PROMPT={prompt}' in run.out assert f'PS1={prompt}' in run.out diff --git a/yadm b/yadm index b5bd5cb..2bbecc8 100755 --- a/yadm +++ b/yadm @@ -919,6 +919,9 @@ function enter() { shell_cmd=('-c' "$*") fi + GIT_WORK_TREE=$(unix_path "$("$GIT_PROGRAM" config core.worktree)") + export GIT_WORK_TREE + [ "${#shell_cmd[@]}" -eq 0 ] && echo "Entering yadm repo" yadm_prompt="yadm shell ($YADM_REPO) $shell_path > "