Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsciple committed Mar 6, 2020
1 parent e9d33f1 commit 0c0c1a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 24 deletions.
7 changes: 2 additions & 5 deletions dist/index.js
Expand Up @@ -5479,12 +5479,9 @@ class GitCommandManager {
yield this.execGit(args);
});
}
submoduleUpdate(fetchDepth, recursive, insteadOfTarget, insteadOfSource) {
submoduleUpdate(fetchDepth, recursive) {
return __awaiter(this, void 0, void 0, function* () {
const args = ['-c', 'protocol.version=2'];
for (const insteadOf in insteadOfSource) {
args.push('-c', `url.${insteadOfTarget}.insteadOf=${insteadOf}`);
}
args.push('submodule', 'update', '--init', '--force');
if (fetchDepth > 0) {
args.push(`--depth=${fetchDepth}`);
Expand Down Expand Up @@ -5746,7 +5743,7 @@ function getSource(settings) {
yield authHelper.configureGlobalAuth();
// Checkout submodules
yield git.submoduleSync(settings.nestedSubmodules);
yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules, `https://${hostname}`, settings.submodules ? ['git@github.com:'] : []);
yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
// Persist credentials
if (settings.persistCredentials) {
Expand Down
18 changes: 2 additions & 16 deletions src/git-command-manager.ts
Expand Up @@ -35,12 +35,7 @@ export interface IGitCommandManager {
setEnvironmentVariable(name: string, value: string): void
submoduleForeach(command: string, recursive: boolean): Promise<string>
submoduleSync(recursive: boolean): Promise<void>
submoduleUpdate(
fetchDepth: number,
recursive: boolean,
insteadOfTarget: string,
insteadOfSource: string[]
): Promise<void>
submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void>
tagExists(pattern: string): Promise<boolean>
tryClean(): Promise<boolean>
tryConfigUnset(configKey: string, globalConfig?: boolean): Promise<boolean>
Expand Down Expand Up @@ -266,17 +261,8 @@ class GitCommandManager {
await this.execGit(args)
}

async submoduleUpdate(
fetchDepth: number,
recursive: boolean,
insteadOfTarget: string,
insteadOfSource: string[]
): Promise<void> {
async submoduleUpdate(fetchDepth: number, recursive: boolean): Promise<void> {
const args = ['-c', 'protocol.version=2']
for (const insteadOf in insteadOfSource) {
args.push('-c', `url.${insteadOfTarget}.insteadOf=${insteadOf}`)
}

args.push('submodule', 'update', '--init', '--force')
if (fetchDepth > 0) {
args.push(`--depth=${fetchDepth}`)
Expand Down
4 changes: 1 addition & 3 deletions src/git-source-provider.ts
Expand Up @@ -123,9 +123,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
await git.submoduleSync(settings.nestedSubmodules)
await git.submoduleUpdate(
settings.fetchDepth,
settings.nestedSubmodules,
`https://${hostname}`,
settings.submodules ? ['git@github.com:'] : []
settings.nestedSubmodules
)
await git.submoduleForeach(
'git config --local gc.auto 0',
Expand Down

0 comments on commit 0c0c1a1

Please sign in to comment.