fix bug when push a branch name with / & fix an integration test bug (#1689)

This commit is contained in:
Lunny Xiao 2017-05-08 10:55:27 +08:00 committed by Bo-Yi Wu
parent 79494047b0
commit 2bb8b3a562
4 changed files with 53 additions and 7 deletions

View file

@ -94,11 +94,12 @@ func initIntegrationTest() {
if err != nil {
log.Fatalf("db.Query: %v", err)
}
if rows.Next() {
break // database already exists
}
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil {
log.Fatalf("db.Exec: %v", err)
defer rows.Close()
if !rows.Next() {
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil {
log.Fatalf("db.Exec: %v", err)
}
}
}
routers.GlobalInit()