Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/src/git-command-manager.ts
diff options
context:
space:
mode:
authorYashwanth Anantharaju <yaananth@users.noreply.github.com>2026-06-01 11:35:58 -0400
committerGitHub <noreply@github.com>2026-06-01 11:35:58 -0400
commiteb9dcad7e007cb96364b4e612799ce0ff736cb09 (patch)
tree2730243bfbc90a8bc802720dc13e2e7ce433e7f2 /src/git-command-manager.ts
parent45c7dc79a6c1ac19a6a0981f08146cb419b30891 (diff)
Fix checkout init for SHA-256 repositories (#2439)
* Fix checkout init for SHA-256 repositories * Remove unused object format result field
Diffstat (limited to 'src/git-command-manager.ts')
-rw-r--r--src/git-command-manager.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/git-command-manager.ts b/src/git-command-manager.ts
index f5ba40e..f1349ce 100644
--- a/src/git-command-manager.ts
+++ b/src/git-command-manager.ts
@@ -43,7 +43,7 @@ export interface IGitCommandManager {
getDefaultBranch(repositoryUrl: string): Promise<string>
getSubmoduleConfigPaths(recursive: boolean): Promise<string[]>
getWorkingDirectory(): string
- init(): Promise<void>
+ init(objectFormat?: string): Promise<void>
isDetached(): Promise<boolean>
lfsFetch(ref: string): Promise<void>
lfsInstall(): Promise<void>
@@ -364,8 +364,14 @@ class GitCommandManager {
return this.workingDirectory
}
- async init(): Promise<void> {
- await this.execGit(['init', this.workingDirectory])
+ async init(objectFormat?: string): Promise<void> {
+ const args = ['init']
+ if (objectFormat === 'sha256') {
+ args.push('--object-format=sha256')
+ }
+ args.push(this.workingDirectory)
+
+ await this.execGit(args)
}
async isDetached(): Promise<boolean> {