Fix bash completion in path with spaces
authorDaniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Mon, 30 Mar 2009 11:27:37 +0000 (19:27 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Mar 2009 16:07:03 +0000 (09:07 -0700)
Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 0bb74c0..8fc01fb 100755 (executable)
@@ -939,7 +939,7 @@ _git_log ()
        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
@@ -1681,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