1 Test varstash integration.
3 $ source $TESTDIR/setup.sh
5 Setup test environment.
9 $ echo 'echo ENTER; autostash FOO=changed' > $AUTOENV_FILE_ENTER
10 $ echo 'echo LEAVE; autounstash' > $AUTOENV_FILE_LEAVE
12 Manually create auth file
14 $ test_autoenv_auth_env_files
16 Set environment variable.
20 Activating the env stashes it and applies a new value.
27 Leaving the directory unstashes it.
35 Test autounstashing when leaving a directory. {{{
41 $ echo 'echo ENTER; autostash VAR=changed' > $AUTOENV_FILE_ENTER
42 $ echo 'echo LEAVE; echo "no explicit call to autounstash"' > $AUTOENV_FILE_LEAVE
43 $ test_autoenv_auth_env_files
55 no explicit call to autounstash
57 Leaving the directory keeps it intact - nothing had been stashed yet.
62 Enter the dir, trigger the autostashing.
73 no explicit call to autounstash
78 Remove the leave file, auto-unstashing should still happen.
80 $ rm sub/$AUTOENV_FILE_LEAVE