making progress
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user