Subject: [PATCH] cg-status: handle subdirs when listing heads

From: Jonas Fonseca <[email-masked]>
Date: Sun, 11 Dec 2005 20:49:26 +0100

Signed-off-by: Jonas Fonseca <[email-masked]>

---

 And here's one which handles empty directories and is cleaner.

diff --git a/cg-status b/cg-status
index a4c5e7a..bd4d0ce 100755
--- a/cg-status
+++ b/cg-status
@@ -123,9 +123,9 @@ if [ "$gitstatus" ]; then
 	fi
 
 	echo "Heads:"
-	for head in $_git/refs/heads/*; do
+	find "$_git/refs/heads" ! -type d | sort | while read head; do 
 		headsha1=$(cat "$head")
-		headname=$(basename "$head")
+		headname=${head#$_git/refs/heads/}
 		[ "$headname" = "cg-seek-point" ] && continue
 		cf=" "; rf=" "
 		[ "$headname" = "$_git_head" ] && cf=">"

-- 
Jonas Fonseca