[PATCH 08/12] completion: simplify _git_bundle
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
contrib/completion/git-completion.bash | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1fe11f4..c26f96c 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1140,16 +1140,18 @@ _git_branch ()
_git_bundle ()
{
- local cmd="${words[2]}"
+ local subcommands='create list-heads verify unbundle'
+ local subcommand="$(__git_find_on_cmdline "$subcommands")"
+
case "$cword" in
2)
- __gitcomp "create list-heads verify unbundle"
+ __gitcomp "$subcommands"
;;
3)
# looking for a file
;;
*)
- case "$cmd" in
+ case "$subcommand" in
create)
__git_complete_revlist
;;
--
1.7.10.3.g5a738d