mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 13:58:09 +08:00 
			
		
		
		
	Add objectFormat setting to allow init()ing a repo with sha256
This commit is contained in:
		| @@ -824,7 +824,8 @@ async function setup(testName: string): Promise<void> { | ||||
|     sshUser: '', | ||||
|     workflowOrganizationId: 123456, | ||||
|     setSafeDirectory: true, | ||||
|     githubServerUrl: githubServerUrl | ||||
|     githubServerUrl: githubServerUrl, | ||||
|     objectFormat: undefined | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -375,4 +375,25 @@ describe('Test fetchDepth and fetchTags options', () => { | ||||
|       expect.any(Object) | ||||
|     ) | ||||
|   }) | ||||
|  | ||||
|   it('should call execGit with the correct arguments when sha256 is used', async () => { | ||||
|     jest.spyOn(exec, 'exec').mockImplementation(mockExec) | ||||
|  | ||||
|     const workingDirectory = 'test' | ||||
|     const lfs = false | ||||
|     const doSparseCheckout = false | ||||
|     git = await commandManager.createCommandManager( | ||||
|       workingDirectory, | ||||
|       lfs, | ||||
|       doSparseCheckout | ||||
|     ) | ||||
|  | ||||
|     await git.init({objectFormat: 'sha256'}) | ||||
|  | ||||
|     expect(mockExec).toHaveBeenCalledWith( | ||||
|       expect.any(String), | ||||
|       ['init', '--object-format=sha256', 'test'], | ||||
|       expect.any(Object) | ||||
|     ) | ||||
|   }) | ||||
| }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user