Test fallback when repo has no submodules

This commit is contained in:
Henry Mercer
2026-03-30 15:58:58 +01:00
parent be0a156326
commit a507a542a4
10 changed files with 32 additions and 54 deletions
+2 -6
View File
@@ -104092,12 +104092,8 @@ function hasSubmodules(gitRoot) {
}
var getFileOidsUnderPath = async function(basePath) {
const gitRoot = await getGitRoot(basePath);
if (gitRoot === void 0) {
throw new Error(
`Cannot determine the Git root from ${basePath}.`
);
}
const args = hasSubmodules(gitRoot) ? ["ls-files", "--recurse-submodules", "--stage"] : ["ls-files", "--stage"];
const mayHaveSubmodules = gitRoot === void 0 ? true : hasSubmodules(gitRoot);
const args = mayHaveSubmodules ? ["ls-files", "--recurse-submodules", "--stage"] : ["ls-files", "--stage"];
const stdout = await runGitCommand(
basePath,
args,