Allow change to a top-level directory within $GIT_REPO_DIR by prefixing the arg with '/'. Comes with tab completion. For example, if you have a directory ~/src/rails, you can move here by typing 's /ra[TAB]'

This commit is contained in:
Nathan Broadbent
2011-12-09 22:59:32 +08:00
parent debcffa417
commit 46637dc15c
2 changed files with 25 additions and 2 deletions

View File

@@ -179,6 +179,14 @@ test_git_index_tab_completion() {
}
# Test changing to top-level directory (when arg begins with '/')
test_changing_to_top_level_directory() {
mkdir "$GIT_REPO_DIR/gems"
git_index "/gems"
assertEquals "$GIT_REPO_DIR/gems" "$PWD"
}
# load and run shUnit2
# Call this function to run tests
. "$scmbDir/test/support/shunit2"