@@ -709,9 +709,14 @@ class GitCommandManager {
709
709
getWorkingDirectory() {
710
710
return this.workingDirectory;
711
711
}
712
- init() {
712
+ init(objectFormat ) {
713
713
return __awaiter(this, void 0, void 0, function* () {
714
- yield this.execGit(['init', this.workingDirectory]);
714
+ const args = ['init'];
715
+ if (objectFormat) {
716
+ args.push(`--object-format=${objectFormat}`);
717
+ }
718
+ args.push(this.workingDirectory);
719
+ yield this.execGit(args);
715
720
});
716
721
}
717
722
isDetached() {
@@ -1236,7 +1241,7 @@ function getSource(settings) {
1236
1241
// Initialize the repository
1237
1242
if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
1238
1243
core.startGroup('Initializing the repository');
1239
- yield git.init();
1244
+ yield git.init(settings.objectFormat );
1240
1245
yield git.remoteAdd('origin', repositoryUrl);
1241
1246
core.endGroup();
1242
1247
}
@@ -1831,6 +1836,9 @@ function getInputs() {
1831
1836
// Determine the GitHub URL that the repository is being hosted from
1832
1837
result.githubServerUrl = core.getInput('github-server-url');
1833
1838
core.debug(`GitHub Host URL = ${result.githubServerUrl}`);
1839
+ // Retrieve the Git object format for initializing a Git repository.
1840
+ result.objectFormat = core.getInput('object-format');
1841
+ core.debug(`git object format = ${result.objectFormat}`);
1834
1842
return result;
1835
1843
});
1836
1844
}
0 commit comments