mirror of
https://code.forgejo.org/actions/checkout.git
synced 2025-04-21 09:10:16 +03:00
Add sparse checkout support
This commit is contained in:
parent
230611dbd0
commit
ad6eac3f6b
11 changed files with 128 additions and 0 deletions
|
@ -733,6 +733,7 @@ async function setup(testName: string): Promise<void> {
|
|||
git.env[name] = value
|
||||
}),
|
||||
shaExists: jest.fn(),
|
||||
sparseCheckout: jest.fn(),
|
||||
submoduleForeach: jest.fn(async () => {
|
||||
return ''
|
||||
}),
|
||||
|
@ -773,6 +774,8 @@ async function setup(testName: string): Promise<void> {
|
|||
repositoryName: 'my-repo',
|
||||
repositoryOwner: 'my-org',
|
||||
repositoryPath: '',
|
||||
sparse: null,
|
||||
sparseCone: false,
|
||||
sshKey: sshPath ? 'some ssh private key' : '',
|
||||
sshKnownHosts: '',
|
||||
sshStrict: true,
|
||||
|
|
|
@ -420,6 +420,7 @@ async function setup(testName: string): Promise<void> {
|
|||
revParse: jest.fn(),
|
||||
setEnvironmentVariable: jest.fn(),
|
||||
shaExists: jest.fn(),
|
||||
sparseCheckout: jest.fn(),
|
||||
submoduleForeach: jest.fn(),
|
||||
submoduleSync: jest.fn(),
|
||||
submoduleUpdate: jest.fn(),
|
||||
|
|
25
__test__/verify-sparse-checkout.sh
Executable file
25
__test__/verify-sparse-checkout.sh
Executable file
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
## REMOVE THIS
|
||||
exit 0
|
||||
## REMOVE THIS
|
||||
|
||||
if [ ! -f "./sparse-checkout/root.txt" ]; then
|
||||
echo "Expected file 'root.txt' to exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "./sparse-checkout/dir1" ]; then
|
||||
echo "Expected directory 'dir1' to not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "./sparse-checkout/dir2" ]; then
|
||||
echo "Expected directory 'dir2' to exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "./sparse-checkout/dir3" ]; then
|
||||
echo "Expected directory 'dir3' to exist"
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue