1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 00:38:36 +00:00

Revert changes related to getpatch/getdiff because they are extracted to another PR

This commit is contained in:
Lunny Xiao
2024-12-12 15:35:54 -08:00
parent 27b67534e3
commit 92e68ae407
3 changed files with 66 additions and 77 deletions

View File

@@ -12,31 +12,6 @@ import (
"github.com/stretchr/testify/assert"
)
func Test_parseCompareArgs(t *testing.T) {
testCases := []struct {
compareString string
expected []string
}{
{
"master..develop",
[]string{"master", "develop"},
},
{
"master HEAD",
[]string{"master", "HEAD"},
},
{
"HEAD...develop",
[]string{"HEAD...develop"},
},
}
for _, tc := range testCases {
args := parseCompareArgs(tc.compareString)
assert.Equal(t, tc.expected, args)
}
}
func TestGetFormatPatch(t *testing.T) {
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
clonedPath, err := cloneRepo(t, bareRepo1Path)
@@ -53,7 +28,7 @@ func TestGetFormatPatch(t *testing.T) {
defer repo.Close()
rd := &bytes.Buffer{}
err = repo.GetPatch("8d92fc95^...8d92fc95", rd)
err = repo.GetPatch("8d92fc95^", "8d92fc95", rd)
if err != nil {
assert.NoError(t, err)
return