Skip to content

Commit 6643a7d

Browse files
committed
Only require Git 2.36.0 when repo contains submodules
1 parent a899987 commit 6643a7d

13 files changed

+4211
-4005
lines changed

lib/analyze-action-post.js

Lines changed: 778 additions & 766 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze-action.js

Lines changed: 380 additions & 368 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/autobuild-action.js

Lines changed: 320 additions & 308 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post.js

Lines changed: 837 additions & 825 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action.js

Lines changed: 387 additions & 375 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js

Lines changed: 309 additions & 297 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql-action.js

Lines changed: 322 additions & 310 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-lib.js

Lines changed: 351 additions & 339 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/upload-sarif-action.js

Lines changed: 355 additions & 343 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config-utils.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ interface OverlayDatabaseModeTestSetup {
10041004
codeqlVersion: string;
10051005
gitRoot: string | undefined;
10061006
gitVersion: GitVersionInfo | undefined;
1007+
hasSubmodules: boolean;
10071008
codeScanningConfig: UserConfig;
10081009
diskUsage: DiskUsage | undefined;
10091010
memoryFlagValue: number;
@@ -1020,10 +1021,8 @@ const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = {
10201021
languages: [KnownLanguage.javascript],
10211022
codeqlVersion: CODEQL_OVERLAY_MINIMUM_VERSION,
10221023
gitRoot: "/some/git/root",
1023-
gitVersion: new GitVersionInfo(
1024-
gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY,
1025-
gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY,
1026-
),
1024+
gitVersion: new GitVersionInfo("2.39.0", "2.39.0"),
1025+
hasSubmodules: false,
10271026
codeScanningConfig: {},
10281027
diskUsage: {
10291028
numAvailableBytes: 50_000_000_000,
@@ -1099,6 +1098,9 @@ const checkOverlayEnablementMacro = test.macro({
10991098
sinon.stub(gitUtils, "getGitRoot").resolves(setup.gitRoot);
11001099
}
11011100

1101+
// Mock submodule detection
1102+
sinon.stub(gitUtils, "hasSubmodules").resolves(setup.hasSubmodules);
1103+
11021104
// Mock default branch detection
11031105
sinon
11041106
.stub(gitUtils, "isAnalyzingDefaultBranch")
@@ -1933,10 +1935,11 @@ test.serial(
19331935

19341936
test.serial(
19351937
checkOverlayEnablementMacro,
1936-
"Fallback due to old git version",
1938+
"Fallback due to old git version with submodules",
19371939
{
19381940
overlayDatabaseEnvVar: "overlay",
1939-
gitVersion: new GitVersionInfo("2.10.0", "2.10.0"), // Version below required 2.11.0
1941+
gitVersion: new GitVersionInfo("2.34.1", "2.34.1"), // Above 2.11.0 but below 2.36.0
1942+
hasSubmodules: true,
19401943
},
19411944
{
19421945
disabledReason: OverlayDisabledReason.IncompatibleGit,

0 commit comments

Comments
 (0)