This commit is contained in:
vvish 2021-10-21 14:45:05 +00:00 committed by GitHub
commit b405d4438d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 38 additions and 2 deletions

View file

@ -763,6 +763,7 @@ async function setup(testName: string): Promise<void> {
lfs: false,
submodules: false,
nestedSubmodules: false,
submodulesFetchDepth: 1,
persistCredentials: true,
ref: 'refs/heads/main',
repositoryName: 'my-repo',

View file

@ -75,6 +75,7 @@ describe('input-helper tests', () => {
expect(settings.commit).toBeTruthy()
expect(settings.commit).toBe('1234567890123456789012345678901234567890')
expect(settings.fetchDepth).toBe(1)
expect(settings.submodulesFetchDepth).toBe(1)
expect(settings.lfs).toBe(false)
expect(settings.ref).toBe('refs/heads/some-ref')
expect(settings.repositoryName).toBe('some-repo')
@ -123,4 +124,18 @@ describe('input-helper tests', () => {
expect(settings.ref).toBe('refs/heads/some-other-ref')
expect(settings.commit).toBeFalsy()
})
it('sets submodulesFetchDepth independently from fetchDepth', () => {
inputs['fetch-depth'] = '10'
inputs['submodules-fetch-depth'] = '20'
const settings: IGitSourceSettings = inputHelper.getInputs()
expect(settings.submodulesFetchDepth).toBe(20)
})
it('sets submodulesFetchDepth equal to fetchDepth by default', () => {
inputs['fetch-depth'] = '10'
const settings: IGitSourceSettings = inputHelper.getInputs()
expect(settings.submodulesFetchDepth).toBe(10)
})
})