mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Save a computation of the git root
This commit is contained in:
Generated
+8
-8
@@ -104087,17 +104087,17 @@ var getGitRoot = async function(sourceRoot) {
|
||||
return void 0;
|
||||
}
|
||||
};
|
||||
async function hasSubmodules(basePath) {
|
||||
const gitRoot = await getGitRoot(basePath);
|
||||
if (gitRoot === void 0) {
|
||||
throw new Error(
|
||||
`Cannot determine whether the repository has submodules because the Git root could not be found from ${basePath}.`
|
||||
);
|
||||
}
|
||||
function hasSubmodules(gitRoot) {
|
||||
return fs3.existsSync(path3.join(gitRoot, ".gitmodules"));
|
||||
}
|
||||
var getFileOidsUnderPath = async function(basePath) {
|
||||
const args = await hasSubmodules(basePath) ? ["ls-files", "--recurse-submodules", "--stage"] : ["ls-files", "--stage"];
|
||||
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 stdout = await runGitCommand(
|
||||
basePath,
|
||||
args,
|
||||
|
||||
Reference in New Issue
Block a user