summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/access_test.go1
-rw-r--r--models/admin_test.go1
-rw-r--r--models/attachment_test.go1
-rw-r--r--models/branches_test.go1
-rw-r--r--models/commit_status_test.go1
-rw-r--r--models/consistency_test.go1
-rwxr-xr-xmodels/db/engine.go10
-rw-r--r--models/issue_assignees_test.go1
-rw-r--r--models/issue_comment_test.go1
-rw-r--r--models/issue_dependency_test.go1
-rw-r--r--models/issue_label_test.go1
-rw-r--r--models/issue_list.go1
-rw-r--r--models/issue_test.go1
-rw-r--r--models/issue_tracked_time_test.go1
-rw-r--r--models/issue_user_test.go1
-rw-r--r--models/issue_watch_test.go1
-rw-r--r--models/migrations/v142.go1
-rw-r--r--models/migrations/v144.go1
-rw-r--r--models/migrations/v175.go1
-rw-r--r--models/migrations/v177_test.go1
-rw-r--r--models/migrations/v191.go1
-rw-r--r--models/notification_test.go1
-rw-r--r--models/org_team_test.go1
-rw-r--r--models/pull_test.go1
-rw-r--r--models/repo.go3
-rw-r--r--models/repo_collaboration_test.go1
-rw-r--r--models/repo_indexer.go1
-rw-r--r--models/repo_permission_test.go1
-rw-r--r--models/repo_redirect_test.go1
-rw-r--r--models/repo_transfer_test.go1
-rw-r--r--models/review_test.go1
-rw-r--r--models/ssh_key.go2
-rw-r--r--models/ssh_key_deploy.go1
-rw-r--r--models/ssh_key_fingerprint.go1
-rw-r--r--models/ssh_key_parse.go1
-rw-r--r--models/star_test.go1
-rw-r--r--models/token_test.go1
-rw-r--r--models/topic_test.go1
-rw-r--r--models/unittest/fixtures.go1
-rw-r--r--models/user.go4
-rw-r--r--models/user_email.go1
41 files changed, 44 insertions, 12 deletions
diff --git a/models/access_test.go b/models/access_test.go
index 96aa34edb6..942ca4af42 100644
--- a/models/access_test.go
+++ b/models/access_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/admin_test.go b/models/admin_test.go
index 95415731b2..8c1deda5f8 100644
--- a/models/admin_test.go
+++ b/models/admin_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/attachment_test.go b/models/attachment_test.go
index c394990536..4081811d19 100644
--- a/models/attachment_test.go
+++ b/models/attachment_test.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/branches_test.go b/models/branches_test.go
index 787dd7fe83..187f23d41b 100644
--- a/models/branches_test.go
+++ b/models/branches_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/commit_status_test.go b/models/commit_status_test.go
index 32d6a433ce..02e3849357 100644
--- a/models/commit_status_test.go
+++ b/models/commit_status_test.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/structs"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/consistency_test.go b/models/consistency_test.go
index 6995f47c87..d49a0132f0 100644
--- a/models/consistency_test.go
+++ b/models/consistency_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/db/engine.go b/models/db/engine.go
index e392008020..b97e954cc3 100755
--- a/models/db/engine.go
+++ b/models/db/engine.go
@@ -16,17 +16,13 @@ import (
"code.gitea.io/gitea/modules/setting"
- // Needed for the MySQL driver
- _ "github.com/go-sql-driver/mysql"
"xorm.io/xorm"
"xorm.io/xorm/names"
"xorm.io/xorm/schemas"
- // Needed for the Postgresql driver
- _ "github.com/lib/pq"
-
- // Needed for the MSSQL driver
- _ "github.com/denisenkom/go-mssqldb"
+ _ "github.com/denisenkom/go-mssqldb" // Needed for the MSSQL driver
+ _ "github.com/go-sql-driver/mysql" // Needed for the MySQL driver
+ _ "github.com/lib/pq" // Needed for the Postgresql driver
)
var (
diff --git a/models/issue_assignees_test.go b/models/issue_assignees_test.go
index 8e2256072a..d1ce000de6 100644
--- a/models/issue_assignees_test.go
+++ b/models/issue_assignees_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_comment_test.go b/models/issue_comment_test.go
index 27c50a3ae4..4d3607b3e1 100644
--- a/models/issue_comment_test.go
+++ b/models/issue_comment_test.go
@@ -9,6 +9,7 @@ import (
"time"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_dependency_test.go b/models/issue_dependency_test.go
index c357d35c50..86ac98b733 100644
--- a/models/issue_dependency_test.go
+++ b/models/issue_dependency_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_label_test.go b/models/issue_label_test.go
index 658c459ba5..d0f807a56e 100644
--- a/models/issue_label_test.go
+++ b/models/issue_label_test.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_list.go b/models/issue_list.go
index ac7ec7ccbf..04dcc58422 100644
--- a/models/issue_list.go
+++ b/models/issue_list.go
@@ -8,6 +8,7 @@ import (
"fmt"
"code.gitea.io/gitea/models/db"
+
"xorm.io/builder"
)
diff --git a/models/issue_test.go b/models/issue_test.go
index f53febb1b3..7942b7e785 100644
--- a/models/issue_test.go
+++ b/models/issue_test.go
@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_tracked_time_test.go b/models/issue_tracked_time_test.go
index 9bc9664521..83420f5a15 100644
--- a/models/issue_tracked_time_test.go
+++ b/models/issue_tracked_time_test.go
@@ -9,6 +9,7 @@ import (
"time"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_user_test.go b/models/issue_user_test.go
index 1be2763703..daa68d731e 100644
--- a/models/issue_user_test.go
+++ b/models/issue_user_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/issue_watch_test.go b/models/issue_watch_test.go
index 18d49bfce5..f75677d68c 100644
--- a/models/issue_watch_test.go
+++ b/models/issue_watch_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/migrations/v142.go b/models/migrations/v142.go
index 1abdd34961..d8ccc112d6 100644
--- a/models/migrations/v142.go
+++ b/models/migrations/v142.go
@@ -6,6 +6,7 @@ package migrations
import (
"code.gitea.io/gitea/modules/log"
+
"xorm.io/builder"
"xorm.io/xorm"
)
diff --git a/models/migrations/v144.go b/models/migrations/v144.go
index 311bb93e3b..81279a54c9 100644
--- a/models/migrations/v144.go
+++ b/models/migrations/v144.go
@@ -6,6 +6,7 @@ package migrations
import (
"code.gitea.io/gitea/modules/log"
+
"xorm.io/builder"
"xorm.io/xorm"
)
diff --git a/models/migrations/v175.go b/models/migrations/v175.go
index 0044ed1845..2dfefe987b 100644
--- a/models/migrations/v175.go
+++ b/models/migrations/v175.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
+
"xorm.io/xorm"
)
diff --git a/models/migrations/v177_test.go b/models/migrations/v177_test.go
index 02cb1d2652..f5fc793aa4 100644
--- a/models/migrations/v177_test.go
+++ b/models/migrations/v177_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/modules/timeutil"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/migrations/v191.go b/models/migrations/v191.go
index 10dfad4f04..c91990e0f3 100644
--- a/models/migrations/v191.go
+++ b/models/migrations/v191.go
@@ -6,6 +6,7 @@ package migrations
import (
"code.gitea.io/gitea/modules/setting"
+
"xorm.io/xorm"
)
diff --git a/models/notification_test.go b/models/notification_test.go
index db2164a2f5..19fad25f99 100644
--- a/models/notification_test.go
+++ b/models/notification_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/org_team_test.go b/models/org_team_test.go
index 9277ac4f5e..b912dd83f2 100644
--- a/models/org_team_test.go
+++ b/models/org_team_test.go
@@ -9,6 +9,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/pull_test.go b/models/pull_test.go
index 0225b421fb..c967cca313 100644
--- a/models/pull_test.go
+++ b/models/pull_test.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/repo.go b/models/repo.go
index 16396e181d..d45f1b2fc3 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -10,7 +10,6 @@ import (
"errors"
"fmt"
"html/template"
- _ "image/jpeg" // Needed for jpeg support
"net"
"net/url"
"os"
@@ -22,6 +21,8 @@ import (
"time"
"unicode/utf8"
+ _ "image/jpeg" // Needed for jpeg support
+
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/models/webhook"
diff --git a/models/repo_collaboration_test.go b/models/repo_collaboration_test.go
index 9b698c0af6..060afc2139 100644
--- a/models/repo_collaboration_test.go
+++ b/models/repo_collaboration_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/repo_indexer.go b/models/repo_indexer.go
index 7029b0922b..e0511b325e 100644
--- a/models/repo_indexer.go
+++ b/models/repo_indexer.go
@@ -8,6 +8,7 @@ import (
"fmt"
"code.gitea.io/gitea/models/db"
+
"xorm.io/builder"
)
diff --git a/models/repo_permission_test.go b/models/repo_permission_test.go
index b64fe37911..180a85a2f5 100644
--- a/models/repo_permission_test.go
+++ b/models/repo_permission_test.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/repo_redirect_test.go b/models/repo_redirect_test.go
index a9d3cc1494..6e5b9fc080 100644
--- a/models/repo_redirect_test.go
+++ b/models/repo_redirect_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/repo_transfer_test.go b/models/repo_transfer_test.go
index df4f83919b..368fea598d 100644
--- a/models/repo_transfer_test.go
+++ b/models/repo_transfer_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/review_test.go b/models/review_test.go
index 2d07ea2ce4..7b8b86df13 100644
--- a/models/review_test.go
+++ b/models/review_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/ssh_key.go b/models/ssh_key.go
index c08fb72e75..baa0d2a54f 100644
--- a/models/ssh_key.go
+++ b/models/ssh_key.go
@@ -15,8 +15,8 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
- "golang.org/x/crypto/ssh"
+ "golang.org/x/crypto/ssh"
"xorm.io/builder"
)
diff --git a/models/ssh_key_deploy.go b/models/ssh_key_deploy.go
index 34cf03e925..4e3910d556 100644
--- a/models/ssh_key_deploy.go
+++ b/models/ssh_key_deploy.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/modules/timeutil"
+
"xorm.io/builder"
"xorm.io/xorm"
)
diff --git a/models/ssh_key_fingerprint.go b/models/ssh_key_fingerprint.go
index 93c455e489..85296c961c 100644
--- a/models/ssh_key_fingerprint.go
+++ b/models/ssh_key_fingerprint.go
@@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
+
"golang.org/x/crypto/ssh"
)
diff --git a/models/ssh_key_parse.go b/models/ssh_key_parse.go
index d2c24b0a2a..748c66da7d 100644
--- a/models/ssh_key_parse.go
+++ b/models/ssh_key_parse.go
@@ -22,6 +22,7 @@ import (
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
+
"golang.org/x/crypto/ssh"
)
diff --git a/models/star_test.go b/models/star_test.go
index e131372733..f9a7ddb0f2 100644
--- a/models/star_test.go
+++ b/models/star_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/token_test.go b/models/token_test.go
index 191da7820e..007148870a 100644
--- a/models/token_test.go
+++ b/models/token_test.go
@@ -8,6 +8,7 @@ import (
"testing"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/topic_test.go b/models/topic_test.go
index def946b666..a38ed64940 100644
--- a/models/topic_test.go
+++ b/models/topic_test.go
@@ -9,6 +9,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
+
"github.com/stretchr/testify/assert"
)
diff --git a/models/unittest/fixtures.go b/models/unittest/fixtures.go
index af60df7b68..6277d1c725 100644
--- a/models/unittest/fixtures.go
+++ b/models/unittest/fixtures.go
@@ -12,7 +12,6 @@ import (
"code.gitea.io/gitea/models/db"
"github.com/go-testfixtures/testfixtures/v3"
-
"xorm.io/xorm"
"xorm.io/xorm/schemas"
)
diff --git a/models/user.go b/models/user.go
index e3cf94efe0..a87929a35f 100644
--- a/models/user.go
+++ b/models/user.go
@@ -12,7 +12,6 @@ import (
"encoding/hex"
"errors"
"fmt"
- _ "image/jpeg" // Needed for jpeg support
"net/url"
"os"
"path/filepath"
@@ -21,6 +20,8 @@ import (
"time"
"unicode/utf8"
+ _ "image/jpeg" // Needed for jpeg support
+
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/login"
"code.gitea.io/gitea/models/unit"
@@ -39,7 +40,6 @@ import (
"golang.org/x/crypto/bcrypt"
"golang.org/x/crypto/pbkdf2"
"golang.org/x/crypto/scrypt"
-
"xorm.io/builder"
"xorm.io/xorm"
)
diff --git a/models/user_email.go b/models/user_email.go
index 7de577bc2c..bd0da65405 100644
--- a/models/user_email.go
+++ b/models/user_email.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/util"
+
"xorm.io/builder"
)