mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
models: fix xorm variable clobber (#12231)
NewTestEngine() takes a *xorm.Engine as its argument, and then immediately overwrites it. This fixes the model package to not take an unneeded variable, and changes the routers package to not create a nil *xorm.Engine that is immediately discarded by model.
This commit is contained in:
1 parent
48ad76c25e
commit
b49a195839
2 files changed
+2
-4
No files matched your search
+1
-1
@@ -151,7 +151,7 @@ func getEngine() (*xorm.Engine, error) {
|
||||
}
|
||||
|
||||
// NewTestEngine sets a new test xorm.Engine
|
||||
func NewTestEngine(x *xorm.Engine) (err error) {
|
||||
func NewTestEngine() (err error) {
|
||||
x, err = getEngine()
|
||||
if err != nil {
|
||||
return fmt.Errorf("Connect to database: %v", err)
|
||||
|
||||
Reference in new issue
Block a user