diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-28 18:04:24 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-28 18:04:24 (GMT) |
commit | 87cc76fa3a79eb86136e55432bd4e4ecc84744cd (patch) | |
tree | ee6f7060615a519bc5a7454e4d382b19b7ec2fed /t | |
parent | 90bbd502d54fe920356fa9278055dc9c9bfe9a56 (diff) | |
parent | b60e88cc780ea54de65b62437afbeb9c857110f2 (diff) | |
download | git-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.zip git-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.tar.gz git-87cc76fa3a79eb86136e55432bd4e4ecc84744cd.tar.bz2 |
Merge branch 'nd/parseopt-completion'
Hotfix for recently graduated topic that give help to completion
scripts from the Git subcommands that are being completed
* nd/parseopt-completion:
t9902: disable test on the list of merge-strategies under GETTEXT_POISON
completion: clear cached --options when sourcing the completion script
Diffstat (limited to 't')
-rwxr-xr-x | t/t9902-completion.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index e6485fe..b7f5b1e 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1497,4 +1497,35 @@ do ' done +test_expect_success 'sourcing the completion script clears cached commands' ' + __git_compute_all_commands && + verbose test -n "$__git_all_commands" && + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && + verbose test -z "$__git_all_commands" +' + +test_expect_success 'sourcing the completion script clears cached porcelain commands' ' + __git_compute_porcelain_commands && + verbose test -n "$__git_porcelain_commands" && + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && + verbose test -z "$__git_porcelain_commands" +' + +test_expect_success !GETTEXT_POISON 'sourcing the completion script clears cached merge strategies' ' + __git_compute_merge_strategies && + verbose test -n "$__git_merge_strategies" && + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && + verbose test -z "$__git_merge_strategies" +' + +test_expect_success 'sourcing the completion script clears cached --options' ' + __gitcomp_builtin checkout && + verbose test -n "$__gitcomp_builtin_checkout" && + __gitcomp_builtin notes_edit && + verbose test -n "$__gitcomp_builtin_notes_edit" && + . "$GIT_BUILD_DIR/contrib/completion/git-completion.bash" && + verbose test -z "$__gitcomp_builtin_checkout" && + verbose test -z "$__gitcomp_builtin_notes_edit" +' + test_done |