1
0
Fork 0
forked from forgejo/forgejo

bug fixed for message tag

This commit is contained in:
Lunny Xiao 2014-06-28 23:56:41 +08:00
parent 4ce2fa520a
commit 1c46d68aba
6 changed files with 105 additions and 35 deletions

View file

@ -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)
}
}
}