From b10c5df68ba0a0be5b2d9704e7a6fab24e8a8d92 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 24 Feb 2026 11:21:22 -0600 Subject: [PATCH] Make git version detection more robust This detection was previously updated to account for the 'windows' string appearing in the git version. It turns out that this practice isn't Windows-specific, and we should support non-digit version parts more generically. Signed-off-by: Scott K Logan --- vcs2l/clients/git.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcs2l/clients/git.py b/vcs2l/clients/git.py index b8022a3..5ccd601 100644 --- a/vcs2l/clients/git.py +++ b/vcs2l/clients/git.py @@ -1,5 +1,6 @@ import os import subprocess +from itertools import takewhile from shutil import which from vcs2l.clients.vcs_base import VcsClientBase @@ -20,7 +21,9 @@ def get_git_version(cls): prefix = b'git version ' assert output.startswith(prefix) output = output[len(prefix) :].split(maxsplit=1)[0] - cls._git_version = [int(x) for x in output.split(b'.') if x != b'windows'] + cls._git_version = [ + int(x) for x in takewhile(bytes.isdigit, output.split(b'.')) + ] return cls._git_version @staticmethod