diff options
author | Alison Winters <alisonatwork@outlook.com> | 2022-11-21 03:26:59 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-30 03:58:06 +0300 |
commit | 9de31f7bd25029eb6e2292ede6df3a646f261de4 (patch) | |
tree | fa14032562cc90a02788101aa4b7e36c7ecc0658 /t/t9902-completion.sh | |
parent | 9bab766fb28fae57a229bd90558ec4453ca71be9 (diff) |
completion: add case-insensitive match of pseudorefs
When GIT_COMPLETION_IGNORE_CASE is set, also allow lowercase completion
text like "head" to match uppercase HEAD and other pseudorefs.
Signed-off-by: Alison Winters <alisonatwork@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-x | t/t9902-completion.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index d89d0a93a2..d6c0478d98 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -2270,6 +2270,21 @@ test_expect_success 'checkout matches case insensitively with GIT_COMPLETION_IGN ) ' +test_expect_success 'checkout completes pseudo refs' ' + test_completion "git checkout H" <<-\EOF + HEAD Z + EOF +' + +test_expect_success 'checkout completes pseudo refs case insensitively with GIT_COMPLETION_IGNORE_CASE' ' + ( + GIT_COMPLETION_IGNORE_CASE=1 && + test_completion "git checkout h" <<-\EOF + HEAD Z + EOF + ) +' + test_expect_success 'git -C <path> checkout uses the right repo' ' test_completion "git -C subdir -C subsubdir -C .. -C ../otherrepo checkout b" <<-\EOF branch-in-other Z |