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 0bb74c05e52b53fd5afc1645146cfbe8cada4cd2..8fc01fb4971d80a92712aaf5306fce59ece564be 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