cherry_pick_list: quit early if one side is empty
[gitweb.git] / revision.c
index e75079a6e1316c74b4dff702170134dc7559898f..c2fad2fd7e7d83e3cd74faad34ba9427641bef50 100644 (file)
@@ -514,6 +514,9 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
                        right_count++;
        }
 
+       if (!left_count || !right_count)
+               return;
+
        left_first = left_count < right_count;
        init_patch_ids(&ids);
        if (revs->diffopt.nr_paths) {