completion: add comment for test_completion()
authorFelipe Contreras <felipe.contreras@gmail.com>
Sun, 11 Nov 2012 14:35:53 +0000 (15:35 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Nov 2012 18:55:09 +0000 (10:55 -0800)
So that it's easier to understand what it does.

Also, make sure we pass only the first argument for completion.
Shouldn't cause any functional changes because run_completion only
checks $1.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9902-completion.sh

index cbd0fb66f93fae6bb1d9fa341aad3e48c723c0e1..5c06709ea0601a26485c8503b4a91e645ec18226 100755 (executable)
@@ -54,10 +54,14 @@ run_completion ()
        __git_wrap__git_main && print_comp
 }
 
+# Test high-level completion
+# Arguments are:
+# 1: typed text so far (cur)
+# 2: expected completion
 test_completion ()
 {
        test $# -gt 1 && echo "$2" > expected
-       run_completion "$@" &&
+       run_completion "$1" &&
        test_cmp expected out
 }