1
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2025-04-30 15:12:58 +02:00

Add bare option to checkout action

Fixes #603
This commit is contained in:
Mohammad Ismail 2024-11-27 13:44:30 +01:00
parent cbb722410c
commit 83f93bf255
4 changed files with 159 additions and 110 deletions

View file

@ -375,4 +375,42 @@ describe('Test fetchDepth and fetchTags options', () => {
expect.any(Object)
)
})
it('should call execGit with the correct arguments when bare is true', async () => {
jest.spyOn(exec, 'exec').mockImplementation(mockExec)
const workingDirectory = 'test'
const lfs = false
const doSparseCheckout = false
git = await commandManager.createCommandManager(
workingDirectory,
lfs,
doSparseCheckout
)
const refSpec = ['refspec1', 'refspec2']
const options = {
filter: 'filterValue',
bare: true
}
await git.fetch(refSpec, options)
expect(mockExec).toHaveBeenCalledWith(
expect.any(String),
[
'-c',
'protocol.version=2',
'fetch',
'--bare',
'--no-tags',
'--prune',
'--no-recurse-submodules',
'--filter=filterValue',
'origin',
'refspec1',
'refspec2'
],
expect.any(Object)
)
})
})