aboutsummaryrefslogtreecommitdiff
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/install.go4
-rw-r--r--routers/repo/commit.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/routers/install.go b/routers/install.go
index 78ba383d..76c03f05 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -146,9 +146,9 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
}
// Check run user.
- curUser := os.Getenv("USERNAME")
+ curUser := os.Getenv("USER")
if len(curUser) == 0 {
- curUser = os.Getenv("USER")
+ curUser = os.Getenv("USERNAME")
}
// Does not check run user when the install lock is off.
if form.RunUser != curUser {
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 5a7bb589..fed1a6ba 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -52,6 +52,10 @@ func Commits(ctx *middleware.Context, params martini.Params) {
//both `git log branchName` and `git log commitId` work
commits, err := models.GetCommitsByRange(repoPath, branchName, page)
+ if err != nil {
+ ctx.Handle(500, "repo.Commits(get commits)", err)
+ return
+ }
ctx.Data["Username"] = userName
ctx.Data["Reponame"] = repoName