Skip to content

Commit dfe8cb7

Browse files
committed
Fix tests
1 parent 453adc2 commit dfe8cb7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

models/fixtures/branch.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
commit_message: 'first commit'
113113
commit_time: 978307100
114114
pusher_id: 1
115+
is_deleted: false
115116

116117
-
117118
id: 18
@@ -121,6 +122,7 @@
121122
commit_message: 'Initial commit'
122123
commit_time: 1489956479
123124
pusher_id: 1
125+
is_deleted: false
124126

125127
-
126128
id: 19
@@ -140,6 +142,7 @@
140142
commit_message: 'add WoW File'
141143
commit_time: 1579200695
142144
pusher_id: 1
145+
is_deleted: false
143146

144147
-
145148
id: 21

tests/integration/pull_merge_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import (
3030
"code.gitea.io/gitea/modules/git"
3131
"code.gitea.io/gitea/modules/gitrepo"
3232
"code.gitea.io/gitea/modules/queue"
33+
repo_module "code.gitea.io/gitea/modules/repository"
3334
"code.gitea.io/gitea/modules/setting"
3435
api "code.gitea.io/gitea/modules/structs"
3536
"code.gitea.io/gitea/modules/test"
@@ -308,7 +309,8 @@ func TestCantMergeUnrelated(t *testing.T) {
308309
assert.NoError(t, err)
309310
sha := strings.TrimSpace(stdout.String())
310311

311-
_, _, err = git.NewCommand(git.DefaultContext, "update-index", "--add", "--replace", "--cacheinfo").AddDynamicArguments("100644", sha, "somewher-over-the-rainbow").RunStdString(&git.RunOpts{Dir: path})
312+
_, _, err = git.NewCommand(git.DefaultContext, "update-index", "--add", "--replace", "--cacheinfo").
313+
AddDynamicArguments("100644", sha, "somewher-over-the-rainbow").RunStdString(&git.RunOpts{Dir: path})
312314
assert.NoError(t, err)
313315

314316
treeSha, _, err := git.NewCommand(git.DefaultContext, "write-tree").RunStdString(&git.RunOpts{Dir: path})
@@ -344,6 +346,10 @@ func TestCantMergeUnrelated(t *testing.T) {
344346
_, _, err = git.NewCommand(git.DefaultContext, "branch", "unrelated").AddDynamicArguments(commitSha).RunStdString(&git.RunOpts{Dir: path})
345347
assert.NoError(t, err)
346348

349+
// we created a branch to git repository directly, now we need to do a sync to make it available in the database
350+
_, err = repo_module.SyncRepoBranches(db.DefaultContext, repo1.ID, user1.ID)
351+
assert.NoError(t, err)
352+
347353
testEditFileToNewBranch(t, session, "user1", "repo1", "master", "conflict", "README.md", "Hello, World (Edited Once)\n")
348354

349355
// Use API to create a conflicting pr

0 commit comments

Comments
 (0)