making progress

This commit is contained in:
2026-05-07 02:06:54 +02:00
parent 7b7e2d399c
commit dea186c995
39 changed files with 2021 additions and 67 deletions
+4 -1
View File
@@ -54,12 +54,15 @@ func IsEmpty(repoPath string) bool {
}
func Init(path string) error {
// git init --bare works even if the directory doesn't exist yet
cmd := exec.Command("git", "init", "--bare", path)
cmd.Env = []string{"GIT_TERMINAL_PROMPT=0", "HOME=/tmp"}
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("git init --bare: %w: %s", err, out)
}
// Allow pushes over HTTP (git http-backend checks this config key)
cfg := exec.Command("git", "-C", path, "config", "http.receivepack", "true")
cfg.Env = []string{"GIT_TERMINAL_PROMPT=0", "HOME=/tmp"}
_ = cfg.Run()
return nil
}