Code

Merge branch 'maint-1.5.6' into maint-1.6.0
[git.git] / contrib / completion / git-completion.bash
index bec09bdd62130a03dc2e95874a54e339ecf5e2d4..8fc01fb4971d80a92712aaf5306fce59ece564be 100755 (executable)
@@ -937,6 +937,11 @@ _git_log ()
        __git_has_doubledash && return
 
        local cur="${COMP_WORDS[COMP_CWORD]}"
+       local g="$(git rev-parse --git-dir 2>/dev/null)"
+       local merge=""
+       if [ -f "$g/MERGE_HEAD" ]; then
+               merge="--merge"
+       fi
        case "$cur" in
        --pretty=*)
                __gitcomp "
@@ -968,7 +973,7 @@ _git_log ()
                        --decorate --diff-filter=
                        --color-words --walk-reflogs
                        --parents --children --full-history
-                       --merge
+                       $merge
                        "
                return
                ;;
@@ -1344,7 +1349,7 @@ _git_revert ()
                return
                ;;
        esac
-       COMPREPLY=()
+       __gitcomp "$(__git_refs)"
 }
 
 _git_rm ()
@@ -1676,7 +1681,7 @@ _gitk ()
        local cur="${COMP_WORDS[COMP_CWORD]}"
        local g="$(git rev-parse --git-dir 2>/dev/null)"
        local merge=""
-       if [ -f $g/MERGE_HEAD ]; then
+       if [ -f "$g/MERGE_HEAD" ]; then
                merge="--merge"
        fi
        case "$cur" in