diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-05-08 10:55:27 +0800 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-05-08 10:55:27 +0800 |
commit | 2bb8b3a56219f3fcba7c77c7a8fc10769b8c11bd (patch) | |
tree | 0fb4e0e204dc72f99dd3a203ee9062bee3d93392 /integrations/integration_test.go | |
parent | 79494047b062069fd8e692152d29773a22877d76 (diff) | |
download | gitea-2bb8b3a56219f3fcba7c77c7a8fc10769b8c11bd.tar.gz gitea-2bb8b3a56219f3fcba7c77c7a8fc10769b8c11bd.zip |
fix bug when push a branch name with / & fix an integration test bug (#1689)
Diffstat (limited to 'integrations/integration_test.go')
-rw-r--r-- | integrations/integration_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/integrations/integration_test.go b/integrations/integration_test.go index 6696ff65fc..4a809403bd 100644 --- a/integrations/integration_test.go +++ b/integrations/integration_test.go @@ -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() |