From 3d1a967477dd8245dabee6f9f8feb3c1c3924fc3 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 23 Mar 2014 19:53:50 +0800 Subject: [PATCH] bug fixed --- models/repo.go | 7 +++++++ serve.go | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/models/repo.go b/models/repo.go index a37923c8b1f..eafb12f4716 100644 --- a/models/repo.go +++ b/models/repo.go @@ -10,6 +10,7 @@ import ( "fmt" "io/ioutil" "os" + "os/exec" "path" "path/filepath" "regexp" @@ -198,6 +199,12 @@ func CreateRepository(user *User, repoName, desc, repoLang, license string, priv return nil, err } + c := exec.Command("git", "update-server-info") + err = c.Run() + if err != nil { + log.Error("repo.CreateRepository(exec update-server-info): %v", err) + } + return repo, NewRepoAction(user, repo) } diff --git a/serve.go b/serve.go index a8dfe70b4c9..ce1dc3184f5 100644 --- a/serve.go +++ b/serve.go @@ -280,7 +280,10 @@ func runServ(k *cli.Context) { //fmt.Println("...", cmd) //runUpdate(k) - c := exec.Command("exec", "git", "update-server-info") - c.Run() + c := exec.Command("git", "update-server-info") + err := c.Run() + if err != nil { + log.Error("update-server-info: %v", err) + } } }