From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: Wartan Hachaturow <wartan.hachaturow@gmail.com>, git@vger.kernel.org
Subject: [PATCH 1/3] Don't die when there are no branches
Date: Mon, 15 May 2006 11:53:24 +0200 [thread overview]
Message-ID: <20060515095324.GA11386@backpacker.hemma.treskal.com> (raw)
In-Reply-To: <20060510060040.GA3034@diana.vm.bytemark.co.uk>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
stgit/commands/branch.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
c32f6b7bfd81bdbdb136ff72a4ad073e162ab97c
diff --git a/stgit/commands/branch.py b/stgit/commands/branch.py
index c7561a8..2218bbb 100644
--- a/stgit/commands/branch.py
+++ b/stgit/commands/branch.py
@@ -174,11 +174,14 @@ def func(parser, options, args):
branches = os.listdir(os.path.join(basedir.get(), 'refs', 'heads'))
branches.sort()
- max_len = max([len(i) for i in branches])
- print 'Available branches:'
- for i in branches:
- __print_branch(i, max_len)
+ if branches:
+ print 'Available branches:'
+ max_len = max([len(i) for i in branches])
+ for i in branches:
+ __print_branch(i, max_len)
+ else:
+ print 'No branches'
return
elif options.protect:
--
1.3.2.g639c
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
next parent reply other threads:[~2006-05-15 9:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060510060040.GA3034@diana.vm.bytemark.co.uk>
2006-05-15 9:53 ` Karl Hasselström [this message]
2006-05-15 9:54 ` [PATCH 2/3] Handle branch names with slashes Karl Hasselström
2006-05-15 10:22 ` Catalin Marinas
2006-05-15 10:58 ` Karl Hasselström
2006-05-16 6:35 ` [PATCH 1/2] " Karl Hasselström
2006-05-16 6:48 ` Junio C Hamano
2006-05-16 7:45 ` Karl Hasselström
2006-05-17 15:18 ` Catalin Marinas
2006-05-18 6:42 ` Karl Hasselström
2006-05-18 6:50 ` [PATCH] " Karl Hasselström
2006-05-18 12:11 ` Catalin Marinas
2006-05-18 16:00 ` Karl Hasselström
2006-05-18 6:43 ` [PATCH 2/2] Tests for " Karl Hasselström
2006-05-16 6:37 ` Karl Hasselström
2006-05-15 9:55 ` [PATCH 3/3] " Karl Hasselström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060515095324.GA11386@backpacker.hemma.treskal.com \
--to=kha@treskal.com \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
--cc=wartan.hachaturow@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox