From 2bb6bf38ee1e76082298a6423b802e8e6a9c88bb Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 19 Nov 2008 14:03:15 -0500 Subject: Fix git bz file of the last most recent commit rev_list_commits() wasn't working properly when the returned list of commits was empty because "".split("\n") is [""] not []. Special case that. (Reported by Colin Walters.) --- git-bz | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-bz b/git-bz index 1708554..7a0f40c 100755 --- a/git-bz +++ b/git-bz @@ -270,7 +270,10 @@ def rev_list_commits(*args, **kwargs): kwargs_copy = dict(kwargs) kwargs_copy['pretty'] = 'format:%s' output = git.rev_list(*args, **kwargs_copy) - lines = output.split("\n") + if output == "": + lines = [] + else: + lines = output.split("\n") if (len(lines) % 2 != 0): raise RuntimeException("git rev-list didn't return an even number of lines") -- cgit v1.2.3