Merge branch 'tr/maint-1.6.1-doc-format-patch--root' into maint-1.6.1
[gitweb.git] / contrib / completion / git-completion.bash
index e00454983ee16624910e40fec9ddb12849110b1b..3889cfb5aa20c93e6945784e48924dff3d73c391 100755 (executable)
@@ -935,6 +935,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 "
@@ -966,7 +971,7 @@ _git_log ()
                        --decorate --diff-filter=
                        --color-words --walk-reflogs
                        --parents --children --full-history
-                       --merge
+                       $merge
                        "
                return
                ;;
@@ -1751,7 +1756,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