@@ -978,25 +978,26 @@ async function validateOverlayDatabaseMode(
978978 ) ;
979979 return new Failure ( OverlayDisabledReason . NoGitRoot ) ;
980980 }
981- if ( gitVersion === undefined ) {
982- logger . warning (
983- `Cannot build an ${ overlayDatabaseMode } database because ` +
984- "the Git version could not be determined. " +
985- "Falling back to creating a normal full database instead." ,
986- ) ;
987- return new Failure ( OverlayDisabledReason . IncompatibleGit ) ;
988- }
989- if (
990- ( await hasSubmodules ( sourceRoot ) ) &&
991- ! gitVersion . isAtLeast ( GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES )
992- ) {
993- logger . warning (
994- `Cannot build an ${ overlayDatabaseMode } database because ` +
995- "the repository has submodules and the installed Git version is older " +
996- `than ${ GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES } . ` +
997- "Falling back to creating a normal full database instead." ,
998- ) ;
999- return new Failure ( OverlayDisabledReason . IncompatibleGit ) ;
981+ if ( await hasSubmodules ( sourceRoot ) ) {
982+ if ( gitVersion === undefined ) {
983+ logger . warning (
984+ `Cannot build an ${ overlayDatabaseMode } database because ` +
985+ "the repository has submodules and the Git version could not be determined. " +
986+ "Falling back to creating a normal full database instead." ,
987+ ) ;
988+ return new Failure ( OverlayDisabledReason . IncompatibleGit ) ;
989+ }
990+ if (
991+ ! gitVersion . isAtLeast ( GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES )
992+ ) {
993+ logger . warning (
994+ `Cannot build an ${ overlayDatabaseMode } database because ` +
995+ "the repository has submodules and the installed Git version is older " +
996+ `than ${ GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES } . ` +
997+ "Falling back to creating a normal full database instead." ,
998+ ) ;
999+ return new Failure ( OverlayDisabledReason . IncompatibleGit ) ;
1000+ }
10001001 }
10011002
10021003 return new Success ( {
0 commit comments