diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2008-11-19 14:03:15 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2008-11-19 14:03:15 -0500 |
commit | 2bb6bf38ee1e76082298a6423b802e8e6a9c88bb (patch) | |
tree | d86488932613ea864cb8224d3064eab2ed2b2aec | |
parent | a729902746db778d6dc832266aadfed5449b43a3 (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-x | git-bz | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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") |