fix: initialize new repositories with a main branch (#2297)

This commit is contained in:
Carlos Florêncio
2026-08-05 22:34:26 +01:00
committed by GitHub
parent 21ccac0cb2
commit 7cd0989fe8
11 changed files with 370 additions and 90 deletions
@@ -18,7 +18,15 @@ func CommandContext(ctx context.Context, targetPath string, _ *os.File) (*exec.C
return command, nil
}
func runInheritedDirectory(string) int {
// CommitCommandContext creates a Git commit command for targetPath.
func CommitCommandContext(ctx context.Context, targetPath string, _ *os.File, args ...string) (*exec.Cmd, error) {
command := subproc.NewGitCommand(ctx, args...)
command.Dir = targetPath
command.Env = withIsolatedCommitEnvironment(os.Environ())
return command, nil
}
func runInheritedDirectory(string, []string) int {
fmt.Fprintln(os.Stderr, "git init helper is unsupported on this platform")
return 2
}