File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ func (c *commitChecker) IsCommitIDExisting(commitID string) bool {
4747 c .gitRepo , c .gitRepoCloser = r , closer
4848 }
4949
50- exist = c .gitRepo .IsReferenceExist (commitID ) // Don't use IsObjectExist since it doesn't support short hashs with gogit edition.
50+ exist = c .gitRepo .IsReferenceExist (commitID ) // Don't use IsObjectExist since it doesn't support short hashes with gogit edition.
5151 c .commitCache [commitID ] = exist
5252 return exist
5353}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
1717func TestDateTime (t * testing.T ) {
1818 testTz , _ := time .LoadLocation ("America/New_York" )
1919 defer test .MockVariableValue (& setting .DefaultUILocation , testTz )()
20+ defer test .MockVariableValue (& setting .IsProd , true )()
2021 defer test .MockVariableValue (& setting .IsInTesting , false )()
2122
2223 du := NewDateUtils ()
@@ -53,6 +54,7 @@ func TestDateTime(t *testing.T) {
5354func TestTimeSince (t * testing.T ) {
5455 testTz , _ := time .LoadLocation ("America/New_York" )
5556 defer test .MockVariableValue (& setting .DefaultUILocation , testTz )()
57+ defer test .MockVariableValue (& setting .IsProd , true )()
5658 defer test .MockVariableValue (& setting .IsInTesting , false )()
5759
5860 du := NewDateUtils ()
Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ import (
1212
1313 "code.gitea.io/gitea/models/issues"
1414 "code.gitea.io/gitea/models/repo"
15- "code.gitea.io/gitea/models/unittest"
1615 user_model "code.gitea.io/gitea/models/user"
17- "code.gitea.io/gitea/modules/git"
18- "code.gitea.io/gitea/modules/log"
1916 "code.gitea.io/gitea/modules/markup"
2017 "code.gitea.io/gitea/modules/reqctx"
18+ "code.gitea.io/gitea/modules/setting"
2119 "code.gitea.io/gitea/modules/test"
2220 "code.gitea.io/gitea/modules/translation"
2321
5048}
5149
5250func TestMain (m * testing.M ) {
53- unittest .InitSettingsForTesting ()
54- if err := git .InitSimple (context .Background ()); err != nil {
55- log .Fatal ("git init failed, err: %v" , err )
56- }
51+ setting .Markdown .RenderOptionsComment .ShortIssuePattern = true
5752 markup .Init (& markup.RenderHelperFuncs {
5853 IsUsernameMentionable : func (ctx context.Context , username string ) bool {
5954 return username == "mention-user"
You can’t perform that action at this time.
0 commit comments