From 9914c5b38918757597a202d6d4aa50609d94d1b0 Mon Sep 17 00:00:00 2001 From: Suhaib Mujahid Date: Wed, 28 Aug 2024 09:53:03 -0400 Subject: [PATCH] [code_review] Handle cases where `len_common_path()` receive two identical paths --- bugbug/tools/code_review.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bugbug/tools/code_review.py b/bugbug/tools/code_review.py index 2f5136b2d9..1c03c4a320 100644 --- a/bugbug/tools/code_review.py +++ b/bugbug/tools/code_review.py @@ -753,6 +753,9 @@ def parse_text_for_dict(text): def len_common_path(f1, f2): """Find length of the common path.""" f1_subsystems = f1.split("/") + if f1 == f2: + return len(f1_subsystems) + f2_subsystems = f2.split("/") max_common_path_length = next(