Added separate parameter for submodules fetch depth

This commit is contained in:
vvish 2020-11-19 23:26:44 +01:00
parent 5a4ac9002d
commit 25e07a18d3
6 changed files with 38 additions and 2 deletions

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)
})
})