add update

This commit is contained in:
2014-03-16 12:18:34 +08:00
parent f047df6e2b
commit 3035a38caa
4 changed files with 78 additions and 0 deletions

View File

@ -73,6 +73,17 @@ func runServ(*cli.Context) {
if strings.HasSuffix(repoName, ".git") {
repoName = repoName[:len(repoName)-4]
}
os.Setenv("userName", user.Name)
os.Setenv("userId", strconv.Itoa(int(user.Id)))
repo, err := models.GetRepositoryByName(user, repoName)
if err != nil {
println("Unavilable repository", err)
return
}
os.Setenv("repoId", strconv.Itoa(int(repo.Id)))
os.Setenv("repoName", repoName)
isWrite := In(verb, COMMANDS_WRITE)
isRead := In(verb, COMMANDS_READONLY)