Merge branch 'pw/completion-stash' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 5 Feb 2016 22:54:16 +0000 (14:54 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Feb 2016 22:54:16 +0000 (14:54 -0800)
* pw/completion-stash:
completion: update completion arguments for stash

1  2 
contrib/completion/git-completion.bash
index 11bf827fc37ab3d1820b0c568b1d9e67fc71fa3c,07fa13b5672ee8ae60d40374cffcb6ec90ae36a2..59a51fe34449c17b19a4f9cbbf8edc3b4e508eb8
@@@ -1687,12 -1687,8 +1687,12 @@@ _git_rebase (
                        --preserve-merges --stat --no-stat
                        --committer-date-is-author-date --ignore-date
                        --ignore-whitespace --whitespace=
 -                      --autosquash --fork-point --no-fork-point
 -                      --autostash
 +                      --autosquash --no-autosquash
 +                      --fork-point --no-fork-point
 +                      --autostash --no-autostash
 +                      --verify --no-verify
 +                      --keep-empty --root --force-rebase --no-ff
 +                      --exec
                        "
  
                return
@@@ -2372,7 -2368,7 +2372,7 @@@ _git_show_branch (
        case "$cur" in
        --*)
                __gitcomp "
 -                      --all --remotes --topo-order --current --more=
 +                      --all --remotes --topo-order --date-order --current --more=
                        --list --independent --merge-base --no-name
                        --color --no-color
                        --sha1-name --sparse --topics --reflog
  
  _git_stash ()
  {
-       local save_opts='--keep-index --no-keep-index --quiet --patch'
+       local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
        local subcommands='save list show apply clear drop pop create branch'
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
                apply,--*|pop,--*)
                        __gitcomp "--index --quiet"
                        ;;
-               show,--*|drop,--*|branch,--*)
+               drop,--*)
+                       __gitcomp "--quiet"
                        ;;
-               show,*|apply,*|drop,*|pop,*|branch,*)
+               show,--*|branch,--*)
+                       ;;
+               branch,*)
+                 if [ $cword -eq 3 ]; then
+                       __gitcomp_nl "$(__git_refs)";
+                       else
+                               __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
+                                               | sed -n -e 's/:.*//p')"
+                       fi
+                       ;;
+               show,*|apply,*|drop,*|pop,*)
                        __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
                                        | sed -n -e 's/:.*//p')"
                        ;;