]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9902-completion.sh
completion: loosen and document the requirement around completing alias
[thirdparty/git.git] / t / t9902-completion.sh
index 47e20fb8b149de244a9336e509b0852b87281000..a7c3b4eb63abfe251dcb9edc4b14b136dcfc91c6 100755 (executable)
@@ -2464,6 +2464,24 @@ test_expect_success 'completion used <cmd> completion for alias: !f() { : git <c
        EOF
 '
 
+test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd> ; ... }' '
+       test_config alias.co "!f() { : checkout ; if ... } f" &&
+       test_completion "git co m" <<-\EOF
+       main Z
+       mybranch Z
+       mytag Z
+       EOF
+'
+
+test_expect_success 'completion used <cmd> completion for alias: !f() { : <cmd>; ... }' '
+       test_config alias.co "!f() { : checkout; if ... } f" &&
+       test_completion "git co m" <<-\EOF
+       main Z
+       mybranch Z
+       mytag Z
+       EOF
+'
+
 test_expect_success 'completion without explicit _git_xxx function' '
        test_completion "git version --" <<-\EOF
        --build-options Z