mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-05 01:45:22 +02:00
fix: ensure consistent empty repository topics field (#7920)
Resolves #7878 An empty repository topic was not stored consistently across databases, this caused the `ONLY_SHOW_RELEVANT_REPOS` feature to not work correctly. Always store empty repository topics as an empty array to fix this. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7920 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Maks1mS <maks1ms@noreply.codeberg.org> Co-committed-by: Maks1mS <maks1ms@noreply.codeberg.org>
This commit is contained in:
parent
d6ab2a464f
commit
8e2747859b
10 changed files with 163 additions and 2 deletions
|
@ -147,3 +147,13 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) {
|
|||
}
|
||||
require.NoError(t, organization.DeleteOrganization(db.DefaultContext, org), "DeleteOrganization")
|
||||
}
|
||||
|
||||
func TestCreateRepository(t *testing.T) {
|
||||
require.NoError(t, unittest.PrepareTestDatabase())
|
||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
|
||||
|
||||
r, err := CreateRepositoryDirectly(db.DefaultContext, user, user, CreateRepoOptions{Name: "repo-last"})
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, r.Topics)
|
||||
require.Empty(t, r.Topics)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue