aboutsummaryrefslogtreecommitdiffstats
path: root/serve.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-16 02:28:28 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-16 02:28:28 -0400
commit50df58a893b745abff74bdcbb9be3fc0d10d21f4 (patch)
tree7753f6095090e3f0f60a15223fdf3074f0dfb11f /serve.go
parent828c89de996c328bb3759d90be8a8a35b4d9cdc0 (diff)
parent795dad786189aeba9c61452e395bb4ecf5fc2cb9 (diff)
downloadgitea-50df58a893b745abff74bdcbb9be3fc0d10d21f4.tar.gz
gitea-50df58a893b745abff74bdcbb9be3fc0d10d21f4.zip
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'serve.go')
-rw-r--r--serve.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/serve.go b/serve.go
index 68455de3d3..0289c82c38 100644
--- a/serve.go
+++ b/serve.go
@@ -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)