completion: add remaining flags to checkout
authorThomas Braun <thomas.braun@virtuell-zuhause.de>
Tue, 24 Oct 2017 13:19:31 +0000 (15:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Oct 2017 06:12:46 +0000 (15:12 +0900)
In the commits 1fc458d9 (builtin/checkout: add --recurse-submodules
switch, 2017-03-14), 08d595dc (checkout: add --ignore-skip-worktree-bits
in sparse checkout mode, 2013-04-13) and 32669671 (checkout: introduce
--detach synonym for "git checkout foo^{commit}", 2011-02-08) checkout
gained new flags but the completion was not updated, although these flags
are useful completions. Add them.

The flags --force and --ignore-other-worktrees are not added as they are
potentially dangerous.

The flags --progress and --no-progress are only useful for scripting and are
therefore also not included.

Signed-off-by: Thomas Braun <thomas.braun@virtuell-zuhause.de>
Reviewed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
t/t9902-completion.sh

index 0e16f01..539d7f8 100644 (file)
@@ -1250,7 +1250,8 @@ _git_checkout ()
        --*)
                __gitcomp "
                        --quiet --ours --theirs --track --no-track --merge
-                       --conflict= --orphan --patch
+                       --conflict= --orphan --patch --detach --ignore-skip-worktree-bits
+                       --recurse-submodules --no-recurse-submodules
                        "
                ;;
        *)
index 2cb999e..fc614dc 100755 (executable)
@@ -1245,6 +1245,10 @@ test_expect_success 'double dash "git checkout"' '
        --conflict=
        --orphan Z
        --patch Z
+       --detach Z
+       --ignore-skip-worktree-bits Z
+       --recurse-submodules Z
+       --no-recurse-submodules Z
        EOF
 '