Merge branch 'mp/complete-paths'
authorJunio C Hamano <gitster@pobox.com>
Fri, 8 Feb 2013 23:28:42 +0000 (15:28 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Feb 2013 23:28:42 +0000 (15:28 -0800)
The completion script used to let the default completer to suggest
pathnames, which gave too many irrelevant choices (e.g. "git add"
would not want to add an unmodified path).  Teach it to use a more
git-aware logic to enumerate only relevant ones.

* mp/complete-paths:
  git-completion.bash: add support for path completion

1  2 
contrib/completion/git-completion.bash

index 5770b6f2d01c6d08c337a2901bba276f3d99f2d0,51b8b3b5b4ccd80cae4648ffe88ea166f0e4e5c8..c8452fb163c6bf75f01ba8b06ded2b8d82143e21
@@@ -979,15 -1159,13 +1169,20 @@@ _git_clone (
  
  _git_commit ()
  {
-       __git_has_doubledash && return
+       case "$prev" in
+       -c|-C)
+               __gitcomp_nl "$(__git_refs)" "" "${cur}"
+               return
+               ;;
+       esac
  
 +      case "$prev" in
 +      -c|-C)
 +              __gitcomp_nl "$(__git_refs)" "" "${cur}"
 +              return
 +              ;;
 +      esac
 +
        case "$cur" in
        --cleanup=*)
                __gitcomp "default strip verbatim whitespace