Trim git version output

This commit is contained in:
Henry Mercer
2025-12-18 12:52:30 +00:00
parent 358a55e232
commit cec3cc5782
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ export async function getGitVersionOrThrow(): Promise<GitVersionInfo> {
);
// Git version output can vary: "git version 2.40.0" or "git version 2.40.0.windows.1"
// We capture just the major.minor.patch portion to ensure semver compatibility.
const match = stdout.match(/^git version ((\d+\.\d+\.\d+).*)$/);
const match = stdout.trim().match(/^git version ((\d+\.\d+\.\d+).*)$/);
if (match?.[1] && match?.[2]) {
return new GitVersionInfo(match[2], match[1]);
}