diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-16 12:18:34 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-16 12:18:34 +0800 |
commit | 3035a38caab5308ef30720760c99594fd9434176 (patch) | |
tree | 5582169bbb32538651e1a5c71546cd002f002888 /serve.go | |
parent | f047df6e2b69ecb41c3fe4bef746145916aa4063 (diff) | |
download | gitea-3035a38caab5308ef30720760c99594fd9434176.tar.gz gitea-3035a38caab5308ef30720760c99594fd9434176.zip |
add update
Diffstat (limited to 'serve.go')
-rw-r--r-- | serve.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) |