mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 09:10:16 +03:00
Merge 25e07a18d3
into fd47087372
This commit is contained in:
commit
b405d4438d
6 changed files with 38 additions and 2 deletions
|
@ -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',
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue