threads / patch / 19037

patch, 3 partsam: simplify "sq" function by using "git rev-parse --sq-quote"

Subject: [PATCH 3/3] am: simplify "sq" function by using "git rev-parse --sq-quote"

## tl;dr

One message between Apr 24, 2009 and Apr 24, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Christian Couder· Apr 24, 2009, 06:29 UTC · lore
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-am.sh |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
Show changes to git-am.sh +1 −5
diff --git a/git-am.sh b/git-am.sh
index 6d1848b..578780b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -44,11 +44,7 @@ else
 fi
 
 sq () {
-	for sqarg
-	do
-		printf "%s" "$sqarg" |
-		sed -e 's/'\''/'\''\\'\'''\''/g' -e 's/.*/ '\''&'\''/'
-	done
+	git rev-parse --sq-quote "$@"
 }
 
 stop_here () {
-- 
1.6.3.rc1.112.g17e25

← back to recent threads