mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 00:38:48 +00:00
Save a computation of the git root
This commit is contained in:
Generated
+8
-8
@@ -162174,17 +162174,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 fs2.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,
|
||||
|
||||
Generated
+8
-8
@@ -107769,17 +107769,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(path4.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,
|
||||
|
||||
Generated
+8
-8
@@ -104228,17 +104228,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 fs2.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,
|
||||
|
||||
Generated
+8
-8
@@ -165686,17 +165686,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(path4.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,
|
||||
|
||||
Generated
+11
-10
@@ -105312,17 +105312,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(path5.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,
|
||||
@@ -107048,13 +107048,14 @@ async function validateOverlayDatabaseMode(overlayDatabaseMode, useOverlayDataba
|
||||
);
|
||||
return new Failure("incompatible-codeql" /* IncompatibleCodeQl */);
|
||||
}
|
||||
if (await getGitRoot(sourceRoot) === void 0) {
|
||||
const gitRoot = await getGitRoot(sourceRoot);
|
||||
if (gitRoot === void 0) {
|
||||
logger.warning(
|
||||
`Cannot build an ${overlayDatabaseMode} database because the source root "${sourceRoot}" is not inside a git repository. Falling back to creating a normal full database instead.`
|
||||
);
|
||||
return new Failure("no-git-root" /* NoGitRoot */);
|
||||
}
|
||||
if (await hasSubmodules(sourceRoot)) {
|
||||
if (hasSubmodules(gitRoot)) {
|
||||
if (gitVersion === void 0) {
|
||||
logger.warning(
|
||||
`Cannot build an ${overlayDatabaseMode} database because the repository has submodules and the Git version could not be determined. Falling back to creating a normal full database instead.`
|
||||
|
||||
Generated
+8
-8
@@ -104221,17 +104221,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 fs2.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,
|
||||
|
||||
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,
|
||||
|
||||
Generated
+8
-8
@@ -107377,17 +107377,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(path4.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,
|
||||
|
||||
Generated
+8
-8
@@ -107062,17 +107062,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