Skip to contentSkip to conversation

cg-status: quote head name

PATCH New Pavel Roskin 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cg-status: quote head name

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

cg-status +2 -2
index b67f505..2cb86be 100755
@@ -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=">"
Signature · 2 lines
Regards,
Pavel Roskin