threads / patch / 18640

patchFix bash completion in path with spaces

Subject: [PATCH] Fix bash completion in path with spaces

## tl;dr

2 messages between Mar 30, 2009 and Mar 30, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Daniel Cheng (aka SDiZ)· Mar 30, 2009, 11:27 UTC · lore
Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
---
 contrib/completion/git-completion.bash |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.bash +2 −2
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 1c6b0e2..e72ce24 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1103,7 +1103,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
@@ -1943,7 +1943,7 @@ _gitk ()
 	local cur="${COMP_WORDS[COMP_CWORD]}"
 	local g="$(__gitdir)"
 	local merge=""
-	if [ -f $g/MERGE_HEAD ]; then
+	if [ -f "$g/MERGE_HEAD" ]; then
 		merge="--merge"
 	fi
 	case "$cur" in
-- 
1.6.2
Shawn O. Pearce· Mar 30, 2009, 14:39 UTC · re: Daniel Cheng (aka SDiZ) · lore

Re: [PATCH] Fix bash completion in path with spaces

"Daniel Cheng (aka SDiZ)" <j16sdiz+freenet@gmail.com> wrote:
> 
> Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Show 22 quoted lines
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 1c6b0e2..e72ce24 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -1103,7 +1103,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
> @@ -1943,7 +1943,7 @@ _gitk ()
>  	local cur="${COMP_WORDS[COMP_CWORD]}"
>  	local g="$(__gitdir)"
>  	local merge=""
> -	if [ -f $g/MERGE_HEAD ]; then
> +	if [ -f "$g/MERGE_HEAD" ]; then
>  		merge="--merge"
>  	fi
>  	case "$cur" in
-- 
Shawn.

← back to recent threads