[PATCH] cg-status: handle subdirs when listing heads
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
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