refactor: dedupe plugin lowercase helpers

This commit is contained in:
Peter Steinberger
2026-04-07 15:51:58 +01:00
parent 1d7e87580d
commit ea9efc0e81
10 changed files with 31 additions and 22 deletions

View File

@@ -2,6 +2,7 @@ import fs from "node:fs";
import { createRequire } from "node:module";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { resolveGitHeadPath } from "./git-root.js";
import { resolveOpenClawPackageRootSync } from "./openclaw-root.js";
@@ -17,7 +18,7 @@ const formatCommit = (value?: string | null) => {
if (!match) {
return null;
}
return match[0].slice(0, 7).toLowerCase();
return normalizeLowercaseStringOrEmpty(match[0].slice(0, 7));
};
const cachedGitCommitBySearchDir = new Map<string, string | null>();