Commit a57b3ed1 authored by Frank Terbeck's avatar Frank Terbeck

vcsup: Make stack-auto-push-cd work

parent df9ea0c9
......@@ -170,9 +170,10 @@ function +vi-vcsup-destroy() {
function VCSUP_CHPWD_HOOK() {
local context=':vcsup:settings:chpwd'
[[ x${VCSUPGUARD} == x ]] && return
zstyle -t "${context}" stack-auto-push-cd || return
if zstyle -t "${context}" stack-auto-push-cd && [[ x${VCSUPGUARD} == 'x' ]]
then
VCSUP_push "${PWD}"
fi
}
function VCSUP_del() {
......
......@@ -229,6 +229,35 @@ expect_stack "Many entries on the stack #5" \
expect_pwd "Now in previous bottom entry from stack #2" $base/src/drivers/uart
zstyle ':vcsup:*' stack-auto-push false
# The same also works with no tool push calls and *cd* if stack-auto-push-cd
# is true.
zstyle ':vcsup:*' stack-auto-push-cd true
cd $base
tool clear
cd src/drivers/uart || exit 1
cd ../spi || exit 1
cd ../../periph || exit 1
cd mu || exit 1
cd ../usb || exit 1
expect_stack "Many entries on the stack #6" \
$base/src/periph/usb \
$base/src/periph/mu \
$base/src/periph \
$base/src/drivers/spi \
$base/src/drivers/uart
comma +
expect_stack "Many entries on the stack #7" \
$base/src/periph/usb \
$base/src/periph/mu \
$base/src/periph \
$base/src/drivers/spi
expect_pwd "Now in previous bottom entry from stack #3" $base/src/drivers/uart
zstyle ':vcsup:*' stack-auto-push-cd false
# Teardown
printf '\nRemoving test base directory: %s\n' $base
rm -Rf $base || exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment