Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlison Winters <alisonatwork@outlook.com>2022-11-21 03:26:59 +0300
committerJunio C Hamano <gitster@pobox.com>2022-11-30 03:58:06 +0300
commit9de31f7bd25029eb6e2292ede6df3a646f261de4 (patch)
treefa14032562cc90a02788101aa4b7e36c7ecc0658 /t/t9902-completion.sh
parent9bab766fb28fae57a229bd90558ec4453ca71be9 (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-xt/t9902-completion.sh15
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