aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/serve.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-06-28 23:56:41 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-06-28 23:56:41 +0800
commit1c46d68abaf08890e10386b3af674233b4dda2d3 (patch)
treeee366ead93743202b7a1d92936cbaaed76623867 /cmd/serve.go
parent4ce2fa520a1d9c36febd19562015107b74a4bc1d (diff)
downloadgitea-1c46d68abaf08890e10386b3af674233b4dda2d3.tar.gz
gitea-1c46d68abaf08890e10386b3af674233b4dda2d3.zip
bug fixed for message tag
Diffstat (limited to 'cmd/serve.go')
-rw-r--r--cmd/serve.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/cmd/serve.go b/cmd/serve.go
index 2a76da7937..351553b91e 100644
--- a/cmd/serve.go
+++ b/cmd/serve.go
@@ -13,6 +13,7 @@ import (
"strings"
"github.com/codegangsta/cli"
+ "github.com/satori/go.uuid"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
@@ -165,7 +166,9 @@ func runServ(k *cli.Context) {
return
}
- models.SetRepoEnvs(user.Id, user.Name, repoName, repoUserName)
+ //models.SetRepoEnvs(user.Id, user.Name, repoName, repoUserName)
+ uuid := uuid.NewV4().String()
+ os.Setenv("uuid", uuid)
gitcmd := exec.Command(verb, repoPath)
gitcmd.Dir = setting.RepoRootPath
@@ -177,4 +180,24 @@ func runServ(k *cli.Context) {
println("Gogs: internal error:", err)
log.GitLogger.Fatal("Fail to execute git command: %v", err)
}
+
+ if isWrite {
+ tasks, err := models.GetUpdateTasksByUuid(uuid)
+ if err != nil {
+ log.GitLogger.Fatal("Fail to get update task: %v", err)
+ }
+
+ for _, task := range tasks {
+ err = models.Update(task.RefName, task.OldCommitId, task.NewCommitId,
+ user.Name, repoUserName, repoName, user.Id)
+ if err != nil {
+ log.GitLogger.Fatal("Fail to update: %v", err)
+ }
+ }
+
+ err = models.DelUpdateTasksByUuid(uuid)
+ if err != nil {
+ log.GitLogger.Fatal("Fail to del update task: %v", err)
+ }
+ }
}