diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts index 8e42a38..ff4ab44 100644 --- a/src/git-command-manager.ts +++ b/src/git-command-manager.ts @@ -42,7 +42,7 @@ export interface IGitCommandManager { ): Promise getDefaultBranch(repositoryUrl: string): Promise getWorkingDirectory(): string - init(): Promise + init(options?: { objectFormat?: string }): Promise isDetached(): Promise lfsFetch(ref: string): Promise lfsInstall(): Promise @@ -327,8 +327,12 @@ class GitCommandManager { return this.workingDirectory } - async init(): Promise { - await this.execGit(['init', this.workingDirectory]) + async init(options?: { objectFormat?: string }): Promise { + await this.execGit([ + 'init', + ...(options?.objectFormat ? ["--object-format", options.objectFormat] : []), + this.workingDirectory + ]) } async isDetached(): Promise { diff --git a/src/git-source-settings.ts b/src/git-source-settings.ts index 4e41ac3..f26e83f 100644 --- a/src/git-source-settings.ts +++ b/src/git-source-settings.ts @@ -118,4 +118,9 @@ export interface IGitSourceSettings { * User override on the GitHub Server/Host URL that hosts the repository to be cloned */ githubServerUrl: string | undefined + + /** + * Object format used for the repo, if it is not default + */ + objectFormat: string | undefined }