From: Jonas Fonseca Date: Sun, 11 Dec 2005 19:49:26 GMT Subject: [PATCH] cg-status: handle subdirs when listing heads Message-ID: <20051211194926.GG2960@diku.dk> In-Reply-To: <20051211190305.GD2960@diku.dk> Signed-off-by: Jonas Fonseca --- 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