Code

Merge branch 'bs/maint-1.6.0-tree-walk-prefix' into maint
[git.git] / contrib / completion / git-completion.bash
index 6e5260ee7526975bf22b5031bd720a7a323bcf29..8431837f9705d9a940819db4fcd51283f433ba1a 100755 (executable)
@@ -1003,6 +1003,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 "$__git_log_pretty_formats
@@ -1030,7 +1035,7 @@ _git_log ()
                        --decorate
                        --walk-reflogs
                        --parents --children
-                       --merge
+                       $merge
                        $__git_diff_common_options
                        --pickaxe-all --pickaxe-regex
                        "
@@ -1838,7 +1843,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