mirror of
https://github.com/go-gitea/gitea
synced 2025-07-21 17:58:35 +00:00
Replace update repository function in some places (#34566)
`UpdateAllCols` is dangerous, the columns should be updated when necessary. This PR replaces some `updateRepository` invokes to reduce possible problems and wrongly updated time. Some parts have been fixed in #34388, but some are hidden in the function `updateRepository`. Alternatively, using `UpdateRepositoryColsNoAutoTime` to update the changed columns. Some `UpdateRepoSize` invokes are duplicated, so they will be removed when extracting from `updateRepository`.
This commit is contained in:
@@ -245,7 +245,12 @@ func TestDefaultWikiBranch(t *testing.T) {
|
||||
assert.NoError(t, wiki_service.ChangeDefaultWikiBranch(db.DefaultContext, repoWithNoWiki, "main"))
|
||||
|
||||
// repo with wiki
|
||||
assert.NoError(t, repo_model.UpdateRepositoryColsNoAutoTime(db.DefaultContext, &repo_model.Repository{ID: 1, DefaultWikiBranch: "wrong-branch"}))
|
||||
assert.NoError(t, repo_model.UpdateRepositoryColsNoAutoTime(
|
||||
db.DefaultContext,
|
||||
&repo_model.Repository{ID: 1, DefaultWikiBranch: "wrong-branch"},
|
||||
"default_wiki_branch",
|
||||
),
|
||||
)
|
||||
|
||||
ctx, _ := contexttest.MockContext(t, "user2/repo1/wiki")
|
||||
ctx.SetPathParam("*", "Home")
|
||||
|
Reference in New Issue
Block a user