completion: add missing general options
authorFelipe Contreras <felipe.contreras@gmail.com>
Sun, 15 Apr 2012 19:44:18 +0000 (22:44 +0300)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Apr 2012 05:39:06 +0000 (22:39 -0700)
And add relevant tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
t/t9902-completion.sh
index 8c91faf1af966236d3389be2ff0638647e405e7e..b837704a85e30c0ced828e288508d831a394d558 100755 (executable)
@@ -2640,8 +2640,10 @@ _git ()
                        --version
                        --exec-path
                        --html-path
+                       --info-path
                        --work-tree=
                        --namespace=
+                       --no-replace-objects
                        --help
                        "
                        ;;
index de1c3e91d315ba135bbc3b7a9f8fc87e3a43271d..0c0cd4100ed1cfbfb106c1145975d5c33cc3e5d9 100755 (executable)
@@ -180,8 +180,10 @@ test_expect_success 'double dash "git" itself' '
        --version Z
        --exec-path Z
        --html-path Z
+       --info-path Z
        --work-tree=
        --namespace=
+       --no-replace-objects Z
        --help Z
        EOF
        test_completion "git --"
@@ -202,4 +204,18 @@ test_expect_success 'double dash "git checkout"' '
        test_completion "git checkout --"
 '
 
+test_expect_success 'general options' '
+       test_completion "git --ver" "--version " &&
+       test_completion "git --hel" "--help " &&
+       test_completion "git --exe" "--exec-path " &&
+       test_completion "git --htm" "--html-path " &&
+       test_completion "git --pag" "--paginate " &&
+       test_completion "git --no-p" "--no-pager " &&
+       test_completion "git --git" "--git-dir=" &&
+       test_completion "git --wor" "--work-tree=" &&
+       test_completion "git --nam" "--namespace=" &&
+       test_completion "git --bar" "--bare " &&
+       test_completion "git --inf" "--info-path " &&
+       test_completion "git --no-r" "--no-replace-objects "
+'
 test_done