~edwargix/git.sr.ht

b0e624881918418955db2027960fe9440c257ba2 — Armin Weigl 3 years ago 5df8556
Fix common prefix dectection

Previously a rename that should have been rendered as:
	1/2 => 2/2
was rendered as:
	1/{2 => 2}
1 files changed, 2 insertions(+), 0 deletions(-)

M gitsrht/git.py
M gitsrht/git.py => gitsrht/git.py +2 -0
@@ 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