Merge branch 'master'

This commit is contained in:
Nicolas Gourdon
2019-05-08 23:57:57 +02:00
parent c097a29d69
commit 3a3ccf801b
326 changed files with 37528 additions and 829 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -13,6 +13,7 @@ import (
"path"
"regexp"
"sort"
"strings"
"testing"
"code.gitea.io/gitea/integrations"
@@ -120,8 +121,7 @@ func readSQLFromFile(version string) (string, error) {
if err != nil {
return "", err
}
return string(bytes), nil
return string(base.RemoveBOMIfPresent(bytes)), nil
}
func restoreOldDB(t *testing.T, version string) bool {
@@ -199,11 +199,11 @@ func restoreOldDB(t *testing.T, version string) bool {
_, err = db.Exec("DROP DATABASE IF EXISTS gitea")
assert.NoError(t, err)
_, err = db.Exec("CREATE DATABASE gitea")
assert.NoError(t, err)
_, err = db.Exec(data)
assert.NoError(t, err)
statements := strings.Split(data, "\nGO\n")
for _, statement := range statements {
_, err = db.Exec(statement)
assert.NoError(t, err, "Failure whilst running: %s\nError: %v", statement, err)
}
db.Close()
}
return true