diff options
-rwxr-xr-x | scripts/git-cherry-gerrit.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/git-cherry-gerrit.py b/scripts/git-cherry-gerrit.py index bb8235fa..9ee285b2 100755 --- a/scripts/git-cherry-gerrit.py +++ b/scripts/git-cherry-gerrit.py @@ -74,7 +74,11 @@ def main() -> None: for to_hash in to_hashes: to_change_ids.append(get_change_id(git_cat_file, to_hash)) - from_hashes = from_pipe(["git", "rev-list", branch_point + ".." + cherry_from]).split("\n") + from_hashes = [] + buffer = from_pipe(["git", "rev-list", branch_point + ".." + cherry_from]) + # If there are no commits, we want an empty list, not a list with one empty item. + if buffer: + from_hashes = buffer.split("\n") whitelist: List[str] = [] if whitelist_file: with open(whitelist_file, "r") as stream: |