1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-11 05:55:29 +00:00

Avoid re-issuing redundant cross-references. (#8734)

* Avoid re-issuing redundant cross-references.

* Remove unused func; fix lint

* Simplify code as suggested by @laftriks

* Update test
This commit is contained in:
guillep2k
2019-11-18 20:43:03 -03:00
committed by Lauris BH
parent f128e06ea6
commit 2c2b9718e6
4 changed files with 57 additions and 32 deletions

View File

@ -133,7 +133,7 @@ func testCreateIssue(t *testing.T, repo, doer int64, title, content string, ispu
assert.NoError(t, err)
i, err = getIssueByID(sess, i.ID)
assert.NoError(t, err)
assert.NoError(t, i.addCrossReferences(sess, d))
assert.NoError(t, i.addCrossReferences(sess, d, false))
assert.NoError(t, sess.Commit())
return i
}
@ -158,7 +158,7 @@ func testCreateComment(t *testing.T, repo, doer, issue int64, content string) *C
assert.NoError(t, sess.Begin())
_, err := sess.Insert(c)
assert.NoError(t, err)
assert.NoError(t, c.addCrossReferences(sess, d))
assert.NoError(t, c.addCrossReferences(sess, d, false))
assert.NoError(t, sess.Commit())
return c
}