mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-24 03:29:50 +02:00
refactor: GetDiffShortStat and fix panic caused by inconsistent "changed file number" (#39248)
This commit is contained in:
1 parent
e5e7b2e76e
commit
3bd7ea4c9f
13 files changed
+143
-146
No files matched your search
@@ -4,7 +4,6 @@
|
||||
package pull
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"gitea.dev/modules/git"
|
||||
@@ -97,7 +96,7 @@ func TestAddCommitMessageTailer(t *testing.T) {
|
||||
|
||||
func TestResolveMergeMessageTemplate(t *testing.T) {
|
||||
t.Run("NoDefault", func(t *testing.T) {
|
||||
repo, err := git.ForceFastImportWithInit(t.Context(), filepath.Join(t.TempDir(), "test-repo"), []git.FastImportCommit{
|
||||
repo, err := git.ForceFastImportWithInit(t.Context(), t.TempDir(), []git.FastImportCommit{
|
||||
{Ref: "refs/heads/master", Files: []git.FastImportFile{
|
||||
{Path: ".gitea/default_merge_message/REBASE_TEMPLATE.md", Content: "rebase template"},
|
||||
}},
|
||||
@@ -117,7 +116,7 @@ func TestResolveMergeMessageTemplate(t *testing.T) {
|
||||
assert.Equal(t, "rebase template", tmpl)
|
||||
})
|
||||
t.Run("WithDefault", func(t *testing.T) {
|
||||
repo, err := git.ForceFastImportWithInit(t.Context(), filepath.Join(t.TempDir(), "test-repo"), []git.FastImportCommit{
|
||||
repo, err := git.ForceFastImportWithInit(t.Context(), t.TempDir(), []git.FastImportCommit{
|
||||
{Ref: "refs/heads/master", Files: []git.FastImportFile{
|
||||
{Path: ".gitea/default_merge_message/DEFAULT_TEMPLATE.md", Content: "default template"},
|
||||
{Path: ".gitea/default_merge_message/REBASE_TEMPLATE.md", Content: "rebase template"},
|
||||
|
||||
Reference in new issue
Block a user