mirror of
https://github.com/actions/checkout.git
synced 2024-04-27 16:57:09 +08:00
Merge 1bf7689f6b
into 8459bc0c7e
This commit is contained in:
commit
e3a8736c65
@ -482,6 +482,7 @@ describe('git-auth-helper tests', () => {
|
|||||||
)
|
)
|
||||||
settings.persistCredentials = false
|
settings.persistCredentials = false
|
||||||
settings.sshKey = ''
|
settings.sshKey = ''
|
||||||
|
settings.submodules = true
|
||||||
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
||||||
await authHelper.configureAuth()
|
await authHelper.configureAuth()
|
||||||
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
||||||
@ -515,6 +516,7 @@ describe('git-auth-helper tests', () => {
|
|||||||
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsFalseAndSshKeySet
|
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsFalseAndSshKeySet
|
||||||
)
|
)
|
||||||
settings.persistCredentials = false
|
settings.persistCredentials = false
|
||||||
|
settings.submodules = true
|
||||||
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
||||||
await authHelper.configureAuth()
|
await authHelper.configureAuth()
|
||||||
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
||||||
@ -541,6 +543,7 @@ describe('git-auth-helper tests', () => {
|
|||||||
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsTrueAndSshKeyNotSet
|
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsTrueAndSshKeyNotSet
|
||||||
)
|
)
|
||||||
settings.sshKey = ''
|
settings.sshKey = ''
|
||||||
|
settings.submodules = true
|
||||||
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
||||||
await authHelper.configureAuth()
|
await authHelper.configureAuth()
|
||||||
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
||||||
@ -580,6 +583,7 @@ describe('git-auth-helper tests', () => {
|
|||||||
await setup(
|
await setup(
|
||||||
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsTrueAndSshKeySet
|
configureSubmoduleAuth_configuresSubmodulesWhenPersistCredentialsTrueAndSshKeySet
|
||||||
)
|
)
|
||||||
|
settings.submodules = true
|
||||||
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
const authHelper = gitAuthHelper.createAuthHelper(git, settings)
|
||||||
await authHelper.configureAuth()
|
await authHelper.configureAuth()
|
||||||
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
const mockSubmoduleForeach = git.submoduleForeach as jest.Mock<any, any>
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -426,10 +426,12 @@ class GitAuthHelper {
|
|||||||
core.warning(`Failed to remove '${configKey}' from the git config`);
|
core.warning(`Failed to remove '${configKey}' from the git config`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.settings.submodules) {
|
||||||
const pattern = regexpHelper.escape(configKey);
|
const pattern = regexpHelper.escape(configKey);
|
||||||
yield this.git.submoduleForeach(
|
yield this.git.submoduleForeach(
|
||||||
// wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
|
// wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
|
||||||
`sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
|
`sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -364,6 +364,7 @@ class GitAuthHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.settings.submodules) {
|
||||||
const pattern = regexpHelper.escape(configKey)
|
const pattern = regexpHelper.escape(configKey)
|
||||||
await this.git.submoduleForeach(
|
await this.git.submoduleForeach(
|
||||||
// wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
|
// wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
|
||||||
@ -371,4 +372,5 @@ class GitAuthHelper {
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user