@@ -797,30 +797,15 @@ class GitCommandManager {
797
797
}
798
798
submoduleUpdate(fetchDepth, recursive, submoduleDirectories) {
799
799
return __awaiter(this, void 0, void 0, function* () {
800
- if (submoduleDirectories) {
801
- for (const submodule of submoduleDirectories) {
802
- const args = ['-c', 'protocol.version=2'];
803
- args.push('submodule', 'update', '--init', '--force', submodule);
804
- if (fetchDepth > 0) {
805
- args.push(`--depth=${fetchDepth}`);
806
- }
807
- if (recursive) {
808
- args.push('--recursive');
809
- }
810
- yield this.execGit(args);
811
- }
800
+ const args = ['-c', 'protocol.version=2'];
801
+ args.push('submodule', 'update', '--init', '--force', ...submoduleDirectories);
802
+ if (fetchDepth > 0) {
803
+ args.push(`--depth=${fetchDepth}`);
812
804
}
813
- else {
814
- const args = ['-c', 'protocol.version=2'];
815
- args.push('submodule', 'update', '--init', '--force');
816
- if (fetchDepth > 0) {
817
- args.push(`--depth=${fetchDepth}`);
818
- }
819
- if (recursive) {
820
- args.push('--recursive');
821
- }
822
- yield this.execGit(args);
805
+ if (recursive) {
806
+ args.push('--recursive');
823
807
}
808
+ yield this.execGit(args);
824
809
});
825
810
}
826
811
submoduleStatus() {
@@ -1820,7 +1805,7 @@ function getInputs() {
1820
1805
// Submodules
1821
1806
result.submodules = false;
1822
1807
result.nestedSubmodules = false;
1823
- result.submoduleDirectories = null ;
1808
+ result.submoduleDirectories = [] ;
1824
1809
const submodulesString = (core.getInput('submodules') || '').toUpperCase();
1825
1810
if (submodulesString == 'RECURSIVE') {
1826
1811
result.submodules = true;
@@ -1835,9 +1820,6 @@ function getInputs() {
1835
1820
if (!result.submodules)
1836
1821
result.submodules = true;
1837
1822
}
1838
- else {
1839
- result.submoduleDirectories = null;
1840
- }
1841
1823
core.debug(`submodules = ${result.submodules}`);
1842
1824
core.debug(`recursive submodules = ${result.nestedSubmodules}`);
1843
1825
core.debug(`submodule directories = ${result.submoduleDirectories}`);
0 commit comments