fix(backend): preserve local repository creation on macOS (#2052)

This commit is contained in:
nova28
2026-07-30 23:23:39 +08:00
committed by GitHub
parent 21742aa3ef
commit 9b6d976f3b
11 changed files with 518 additions and 22 deletions
@@ -0,0 +1,22 @@
//go:build !linux && !darwin
package gitinit
import (
"context"
"fmt"
"os"
"os/exec"
)
// CommandContext creates a Git initialization command for platforms without inherited fd support.
func CommandContext(ctx context.Context, targetPath string, _ *os.File) (*exec.Cmd, error) {
command := exec.CommandContext(ctx, "git", "init", "--initial-branch=main")
command.Dir = targetPath
return command, nil
}
func runInheritedDirectory(string) int {
fmt.Fprintln(os.Stderr, "git init helper is unsupported on this platform")
return 2
}