diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:48:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-02 15:48:12 -0700 |
commit | f241c08d40ad9d479fb88e99ff0bb90d6dd73eda (patch) | |
tree | 787cc405852e003bbf3d42f3c6f9b8eb681ee2d6 /t | |
parent | 6bf931a54fd66826f28d2808b7ad822024764d41 (diff) | |
parent | c29e317994d1077fe3ac9cdeae5a5b35ffaa3440 (diff) | |
download | git-f241c08d40ad9d479fb88e99ff0bb90d6dd73eda.tar.gz git-f241c08d40ad9d479fb88e99ff0bb90d6dd73eda.tar.xz |
Merge branch 'fc/completion'
* fc/completion:
completion: remove __git_index_file_list_filter()
completion: add space after completed filename
completion: add hack to enable file mode in bash < 4
completion: refactor __git_complete_index_file()
completion: refactor diff_index wrappers
completion: use __gitcompadd for __gitcomp_file
completion; remove unuseful comments
completion: document tilde expansion failure in tests
completion: add file completion tests
Diffstat (limited to 't')
-rwxr-xr-x | t/t9902-completion.sh | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 6d9d1418a..81a1657ef 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -347,4 +347,81 @@ test_expect_success 'send-email' ' test_completion "git send-email ma" "master " ' +test_expect_success 'complete files' ' + git init tmp && cd tmp && + test_when_finished "cd .. && rm -rf tmp" && + + echo "expected" > .gitignore && + echo "out" >> .gitignore && + + git add .gitignore && + test_completion "git commit " ".gitignore" && + + git commit -m ignore && + + touch new && + test_completion "git add " "new" && + + git add new && + git commit -a -m new && + test_completion "git add " "" && + + git mv new modified && + echo modify > modified && + test_completion "git add " "modified" && + + touch untracked && + + : TODO .gitignore should not be here && + test_completion "git rm " <<-\EOF && + .gitignore + modified + EOF + + test_completion "git clean " "untracked" && + + : TODO .gitignore should not be here && + test_completion "git mv " <<-\EOF && + .gitignore + modified + EOF + + mkdir dir && + touch dir/file-in-dir && + git add dir/file-in-dir && + git commit -m dir && + + mkdir untracked-dir && + + : TODO .gitignore should not be here && + test_completion "git mv modified " <<-\EOF && + .gitignore + dir + modified + untracked + untracked-dir + EOF + + test_completion "git commit " "modified" && + + : TODO .gitignore should not be here && + test_completion "git ls-files " <<-\EOF + .gitignore + dir + modified + EOF + + touch momified && + test_completion "git add mom" "momified" +' + +test_expect_failure 'complete with tilde expansion' ' + git init tmp && cd tmp && + test_when_finished "cd .. && rm -rf tmp" && + + touch ~/tmp/file && + + test_completion "git add ~/tmp/" "~/tmp/file" +' + test_done |