prompt: fix show upstream with svn and zsh
[gitweb.git] / contrib / completion / git-completion.bash
index b62bec027963edc8607067e990509b694cdbc9db..e7698003933fb8d8d95d4463c93667cb81162ae4 100644 (file)
@@ -299,9 +299,12 @@ __git_index_file_list_filter ()
 # the second argument.
 __git_ls_files_helper ()
 {
-       # NOTE: $2 is not quoted in order to support multiple options
-       cd "$1" && git ls-files --exclude-standard $2
-} 2>/dev/null
+       (
+               test -n "${CDPATH+set}" && unset CDPATH
+               # NOTE: $2 is not quoted in order to support multiple options
+               cd "$1" && git ls-files --exclude-standard $2
+       ) 2>/dev/null
+}
 
 
 # Execute git diff-index, returning paths relative to the directory
@@ -309,8 +312,11 @@ __git_ls_files_helper ()
 # specified in the second argument.
 __git_diff_index_helper ()
 {
-       cd "$1" && git diff-index --name-only --relative "$2"
-} 2>/dev/null
+       (
+               test -n "${CDPATH+set}" && unset CDPATH
+               cd "$1" && git diff-index --name-only --relative "$2"
+       ) 2>/dev/null
+}
 
 # __git_index_files accepts 1 or 2 arguments:
 # 1: Options to pass to ls-files (required).
@@ -1176,13 +1182,6 @@ _git_commit ()
                ;;
        esac
 
-       case "$prev" in
-       -c|-C)
-               __gitcomp_nl "$(__git_refs)" "" "${cur}"
-               return
-               ;;
-       esac
-
        case "$cur" in
        --cleanup=*)
                __gitcomp "default strip verbatim whitespace
@@ -1821,6 +1820,10 @@ _git_config ()
                __gitcomp_nl "$(__git_refs)"
                return
                ;;
+       branch.*.rebase)
+               __gitcomp "false true"
+               return
+               ;;
        remote.*.fetch)
                local remote="${prev#remote.}"
                remote="${remote%.fetch}"
@@ -1860,6 +1863,10 @@ _git_config ()
                        "
                return
                ;;
+       diff.submodule)
+               __gitcomp "log short"
+               return
+               ;;
        help.format)
                __gitcomp "man info web html"
                return
@@ -2055,13 +2062,14 @@ _git_config ()
                core.whitespace
                core.worktree
                diff.autorefreshindex
-               diff.statGraphWidth
                diff.external
                diff.ignoreSubmodules
                diff.mnemonicprefix
                diff.noprefix
                diff.renameLimit
                diff.renames
+               diff.statGraphWidth
+               diff.submodule
                diff.suppressBlankEmpty
                diff.tool
                diff.wordRegex