Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env bash
# A script to replicate VundleVim/Vundle.vim/issues/807
## Setup
cd /tmp
rm -rf bugtest
mkdir bugtest && cd bugtest && git init
git submodule add -b vundle_bug https://github.com/shippy/dotvim.git dotvim
git submodule update --init --recursive
hook_path=".git/modules/dotvim/hooks/post-checkout"
echo "#!/usr/bin/env bash" > $hook_path
echo "echo 'Vundle update!'" >> $hook_path
exec vim -c VundleUpdate -c PluginClean! -c quitall &> /dev/null
# Use this instead if you wish to step through the code
# echo "exec vim -c 'debug VundleUpdate'" >> $hook_path
chmod +x $hook_path
## Make this the temporary vim config
mv ~/.vim ~/.vim_test
ln -s $(pwd)/dotvim ~/.vim
cd ~/.vim
## Demonstration
echo "dotvim remote is now $(git remote get-url origin)"
# Expected: https://github.com/shippy/dotvim.git
# Actual: https://github.com/shippy/dotvim.git
echo "Trigger post-checkout by re-checking out the current branch"
git checkout vundle_bug
echo "dotvim remote is now $(git remote get-url origin)"
# Expected: https://github.com/shippy/dotvim.git
# Actual: https://github.com/VundleVim/Vundle.vim.git
## Clean-up
rm -f ~/.vim
mv ~/.vim_test ~/.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment