From 031d5976c9d912591fcfe19e71487f3841642096 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 20 Oct 2011 20:20:27 +0800 Subject: [PATCH] Fixed bug when trying to use gc -m "commit message" --- lib/git/status_shortcuts.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh index 49a5a11..8a528f1 100644 --- a/lib/git/status_shortcuts.sh +++ b/lib/git/status_shortcuts.sh @@ -106,7 +106,9 @@ git_expand_args() { for i in $(seq $(echo $arg | tr ".." " ")); do files="$files $(eval echo \$$git_env_char$i)" done - else # Otherwise, treat $arg as a normal string. + else # Otherwise, treat $arg as a normal string. + # If arg contains any spaces, (re)wrap it in double quotes + if echo $arg | grep -q " "; then arg="\"$arg\""; fi files="$files $arg" fi done