mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-07 21:43:23 +09:00
refactor: GetDiffShortStat and fix panic caused by inconsistent "changed file number" (#39248)
This commit is contained in:
@@ -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