summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-11 12:18:56 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-11 12:18:56 +0800
commit5b5d54621e6b17e65e1df9227ca1bd5a66ce86db (patch)
treea2f429c224d0eb3356a6b456ac8fbca0860d3b49 /models
parentf9907bbfa4368be7412ab3ade6be354225409652 (diff)
parent295cfd42aa7a3248c044abdc530a96b722fb5e6b (diff)
downloadgitea-5b5d54621e6b17e65e1df9227ca1bd5a66ce86db.tar.gz
gitea-5b5d54621e6b17e65e1df9227ca1bd5a66ce86db.zip
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'models')
-rw-r--r--models/models.go15
1 files changed, 1 insertions, 14 deletions
diff --git a/models/models.go b/models/models.go
index 7dfc0aaf0a..0566824759 100644
--- a/models/models.go
+++ b/models/models.go
@@ -7,7 +7,6 @@ package models
import (
"fmt"
"os"
- "os/user"
_ "github.com/go-sql-driver/mysql"
"github.com/lunny/xorm"
@@ -47,16 +46,7 @@ func setEngine() {
dbUser := base.Cfg.MustValue("database", "USER")
dbPwd := base.Cfg.MustValue("database", "PASSWD")
- uname, err := user.Current()
- if err != nil {
- fmt.Printf("models.init -> fail to get user: %s\n", err)
- os.Exit(2)
- }
-
- if uname.Username == "jiahuachen" {
- dbPwd = base.Cfg.MustValue("database", "PASSWD_jiahua")
- }
-
+ var err error
switch dbType {
case "mysql":
orm, err = xorm.NewEngine("mysql", fmt.Sprintf("%v:%v@%v/%v?charset=utf8",
@@ -83,9 +73,6 @@ func setEngine() {
//log.Trace("Initialized database -> %s", dbName)
RepoRootPath = base.Cfg.MustValue("repository", "ROOT")
- if uname.Username == "jiahuachen" {
- RepoRootPath = base.Cfg.MustValue("repository", "ROOT_jiahuachen")
- }
}
func init() {