Fix checkout init for SHA-256 repositories (#2439)

* Fix checkout init for SHA-256 repositories

* Remove unused object format result field
This commit is contained in:
Yashwanth Anantharaju
2026-06-01 11:35:58 -04:00
committed by GitHub
parent 900f2210b1
commit 1cce3390c2
6 changed files with 282 additions and 7 deletions
+18 -1
View File
@@ -109,8 +109,25 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
if (
!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))
) {
core.startGroup('Determining repository object format')
const objectFormatResult =
await githubApiHelper.tryGetRepositoryObjectFormat(
settings.authToken,
settings.repositoryOwner,
settings.repositoryName,
settings.githubServerUrl,
settings.commit
)
const objectFormat = objectFormatResult.succeeded
? objectFormatResult.format
: ''
if (objectFormat === 'sha256') {
core.info('Detected SHA-256 repository object format')
}
core.endGroup()
core.startGroup('Initializing the repository')
await git.init()
await git.init(objectFormat)
await git.remoteAdd('origin', repositoryUrl)
core.endGroup()
}