cg-status: list changes even if the list of heads is empty Now that cg-status uses git-for-each-ref which is more resilient to empty list of heads there is no reason to bail out. Additionally, this makes it possible to use cg-status before the initial commit if cg-init -I was used to see added files etc. Signed-off-by: Jonas Fonseca --- commit dd8c503c187d7a8f357f087431636fc015537c20 tree 8f9f5173f87ac66baa5f642e0d54565648c62e63 parent f0c0e465b4e79951ae2b91a9a1b15abc986812a9 author Jonas Fonseca Sat, 18 Nov 2006 09:33:35 +0100 committer Jonas Fonseca Sat, 18 Nov 2006 09:33:35 +0100 cg-status | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cg-status b/cg-status index 3dbdb59..8b2931b 100755 --- a/cg-status +++ b/cg-status @@ -179,11 +179,6 @@ mstatedir="$_git/cg-merge-state" if [ "$gitstatus" ]; then - mkdir -p "$_git/refs/heads" - [ "$(find "$_git/refs/heads" -follow -type f)" ] \ - || die "List of heads is empty." - - [ -s "$_git/branch-name" ] && echo "Branch (informal): $(cat "$_git/branch-name")" if [ -s "$_git/head-name" ]; then @@ -193,7 +188,6 @@ if [ "$gitstatus" ]; then echo fi - echo "Heads:" # -name * will prevent listing hidden heads maxlen="$(git-for-each-ref --format="%(refname)" refs/heads | column_width "refs/heads/")" maxlen=$((maxlen + 1)) @@ -215,6 +209,8 @@ if [ "$gitstatus" ]; then fi maxloglen=$((maxloglen - maxsha1len)) + [ $maxlen -gt 1 ] && echo "Heads:" + git-for-each-ref --format="%(refname) %(objectname) %(subject)" refs/heads | while read head sha1 headlog; do headname="${head#refs/heads/}"