threads / patch / 2512

patchcg-status: quote head name

Subject: [PATCH] cg-status: quote head name

## tl;dr

One message between Nov 14, 2005 and Nov 14, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Pavel Roskin· Nov 14, 2005, 22:57 UTC · lore

cg-status should quote head name to deal with branches that have active characters (e.g. spaces) in the name.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Show changes to cg-status +2 −2
diff --git a/cg-status b/cg-status
index b67f505..2cb86be 100755
--- a/cg-status
+++ b/cg-status
@@ -124,8 +124,8 @@ if [ "$gitstatus" ]; then
 
 	echo "Heads:"
 	for head in $_git/refs/heads/*; do
-		headsha1=$(cat $head)
-		headname=$(basename $head)
+		headsha1=$(cat "$head")
+		headname=$(basename "$head")
 		[ "$headname" = "cg-seek-point" ] && continue
 		cf=" "; rf=" "
 		[ "$headname" = "$_git_head" ] && cf=">"
-- 
Regards,
Pavel Roskin

← back to recent threads