Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary syncbranchToDB with tests (#28624) #28629

Merged
merged 3 commits into from
Dec 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
lunny committed Dec 28, 2023
commit 19552b6a10db75f3c0ebc90b2e4e97feda6d1ed5
6 changes: 3 additions & 3 deletions tests/integration/api_branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func TestAPIBranchProtection(t *testing.T) {
func TestAPICreateBranchWithSyncBranches(t *testing.T) {
defer tests.PrepareTestEnv(t)()

branches, err := db.Find[git_model.Branch](db.DefaultContext, git_model.FindBranchOptions{
branches, err := git_model.FindBranches(db.DefaultContext, git_model.FindBranchOptions{
RepoID: 1,
})
assert.NoError(t, err)
Expand All @@ -235,13 +235,13 @@ func TestAPICreateBranchWithSyncBranches(t *testing.T) {
testAPICreateBranch(t, ctx.Session, "user2", "repo1", "", "new_branch", http.StatusCreated)
})

branches, err = db.Find[git_model.Branch](db.DefaultContext, git_model.FindBranchOptions{
branches, err = git_model.FindBranches(db.DefaultContext, git_model.FindBranchOptions{
RepoID: 1,
})
assert.NoError(t, err)
assert.Len(t, branches, 5)

branches, err = db.Find[git_model.Branch](db.DefaultContext, git_model.FindBranchOptions{
branches, err = git_model.FindBranches(db.DefaultContext, git_model.FindBranchOptions{
RepoID: 1,
Keyword: "new_branch",
})
Expand Down