summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2008-11-19 14:03:15 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2008-11-19 14:03:15 -0500
commit2bb6bf38ee1e76082298a6423b802e8e6a9c88bb (patch)
treed86488932613ea864cb8224d3064eab2ed2b2aec
parenta729902746db778d6dc832266aadfed5449b43a3 (diff)
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.)
-rwxr-xr-xgit-bz5
1 files changed, 4 insertions, 1 deletions
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")