Merge branch 'ph/parseopt-step-blame'
[gitweb.git] / contrib / completion / git-completion.bash
index 27332ed8b1266604594d74b63d806bbaf98f8a88..84a256ec54875288ff0c92e4ce1cc45551667aeb 100755 (executable)
@@ -1163,8 +1163,19 @@ _git_show ()
 _git_stash ()
 {
        local subcommands='save list show apply clear drop pop create'
-       if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
+       local subcommand="$(__git_find_subcommand "$subcommands")"
+       if [ -z "$subcommand" ]; then
                __gitcomp "$subcommands"
+       else
+               local cur="${COMP_WORDS[COMP_CWORD]}"
+               case "$subcommand,$cur" in
+               save,--*)
+                       __gitcomp "--keep-index"
+                       ;;
+               *)
+                       COMPREPLY=()
+                       ;;
+               esac
        fi
 }