]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9902-completion.sh
Merge branch 'sb/object-store-lookup'
[thirdparty/git.git] / t / t9902-completion.sh
index a28640ce1accd604bd32fdc95fd172119f6c3741..5ff43b9cbbe1693ac23ac7f020522d16424cb936 100755 (executable)
@@ -501,6 +501,42 @@ test_expect_success '__gitcomp - suffix' '
        EOF
 '
 
+test_expect_success '__gitcomp - ignore optional negative options' '
+       test_gitcomp "--" "--abc --def --no-one -- --no-two" <<-\EOF
+       --abc Z
+       --def Z
+       --no-one Z
+       --no-... Z
+       EOF
+'
+
+test_expect_success '__gitcomp - ignore/narrow optional negative options' '
+       test_gitcomp "--a" "--abc --abcdef --no-one -- --no-two" <<-\EOF
+       --abc Z
+       --abcdef Z
+       EOF
+'
+
+test_expect_success '__gitcomp - ignore/narrow optional negative options' '
+       test_gitcomp "--n" "--abc --def --no-one -- --no-two" <<-\EOF
+       --no-one Z
+       --no-... Z
+       EOF
+'
+
+test_expect_success '__gitcomp - expand all negative options' '
+       test_gitcomp "--no-" "--abc --def --no-one -- --no-two" <<-\EOF
+       --no-one Z
+       --no-two Z
+       EOF
+'
+
+test_expect_success '__gitcomp - expand/narrow all negative options' '
+       test_gitcomp "--no-o" "--abc --def --no-one -- --no-two" <<-\EOF
+       --no-one Z
+       EOF
+'
+
 test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
        __gitcomp "$invalid_variable_name"
 '
@@ -1067,7 +1103,7 @@ test_expect_success '__git_complete_refs - remote' '
        master-in-other Z
        EOF
        (
-               cur=
+               cur= &&
                __git_complete_refs --remote=other &&
                print_comp
        ) &&
@@ -1086,7 +1122,7 @@ test_expect_success '__git_complete_refs - track' '
        master-in-other Z
        EOF
        (
-               cur=
+               cur= &&
                __git_complete_refs --track &&
                print_comp
        ) &&
@@ -1398,8 +1434,8 @@ test_expect_success 'double dash "git checkout"' '
        --ignore-other-worktrees Z
        --recurse-submodules Z
        --progress Z
-       --no-track Z
-       --no-recurse-submodules Z
+       --no-quiet Z
+       --no-... Z
        EOF
 '
 
@@ -1607,6 +1643,7 @@ test_expect_success 'completion used <cmd> completion for alias: !f() { : git <c
 test_expect_success 'completion without explicit _git_xxx function' '
        test_completion "git version --" <<-\EOF
        --build-options Z
+       --no-build-options Z
        EOF
 '