From b0e624881918418955db2027960fe9440c257ba2 Mon Sep 17 00:00:00 2001 From: Armin Weigl Date: Tue, 16 Mar 2021 18:56:00 +0100 Subject: [PATCH] Fix common prefix dectection Previously a rename that should have been rendered as: 1/2 => 2/2 was rendered as: 1/{2 => 2} --- gitsrht/git.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitsrht/git.py b/gitsrht/git.py index eeea9e3..669913d 100644 --- a/gitsrht/git.py +++ b/gitsrht/git.py @@ -155,6 +155,8 @@ def _diffstat_name(delta, anchor): for i in range(max(len(old_path), len(new_path))): if i >= len(old_path) or i >= len(new_path): break + if old_path[i] != new_path[i]: + break if old_path[i] == '/': pfx_length = i + 1 # TODO: detect common suffix -- 2.38.4