mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 05:25:55 +08:00 
			
		
		
		
	Add support for partial checkout filters (#1396)
* added filter option & tests * added build file * fix test oversight * added exit 1 * updated docs to specify override * undo unneeded readme change * set to undefined rather than empty string * run git config in correct di --------- Co-authored-by: Cory Miller <13227161+cory-miller@users.noreply.github.com>
This commit is contained in:
		| @@ -802,6 +802,7 @@ async function setup(testName: string): Promise<void> { | ||||
|     authToken: 'some auth token', | ||||
|     clean: true, | ||||
|     commit: '', | ||||
|     filter: undefined, | ||||
|     sparseCheckout: [], | ||||
|     sparseCheckoutConeMode: true, | ||||
|     fetchDepth: 1, | ||||
|   | ||||
| @@ -79,6 +79,7 @@ describe('input-helper tests', () => { | ||||
|     expect(settings.clean).toBe(true) | ||||
|     expect(settings.commit).toBeTruthy() | ||||
|     expect(settings.commit).toBe('1234567890123456789012345678901234567890') | ||||
|     expect(settings.filter).toBe(undefined) | ||||
|     expect(settings.sparseCheckout).toBe(undefined) | ||||
|     expect(settings.sparseCheckoutConeMode).toBe(true) | ||||
|     expect(settings.fetchDepth).toBe(1) | ||||
|   | ||||
							
								
								
									
										16
									
								
								__test__/verify-fetch-filter.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								__test__/verify-fetch-filter.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| #!/bin/bash | ||||
|  | ||||
| # Verify .git folder | ||||
| if [ ! -d "./fetch-filter/.git" ]; then | ||||
|   echo "Expected ./fetch-filter/.git folder to exist" | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| # Verify .git/config contains partialclonefilter | ||||
|  | ||||
| CLONE_FILTER=$(git -C fetch-filter config --local --get remote.origin.partialclonefilter) | ||||
|  | ||||
| if [ "$CLONE_FILTER" != "blob:none" ]; then | ||||
|   echo "Expected ./fetch-filter/.git/config to have 'remote.origin.partialclonefilter' set to 'blob:none'" | ||||
|   exit 1 | ||||
| fi | ||||
		Reference in New Issue
	
	Block a user