chore: fix git commit "rev-list" (#38069)

Fix the copied & pasted messy code, fix #38067

Now, "limit=-1" means "no limit"
This commit is contained in:
wxiaoguang
2026-06-12 02:08:55 +08:00
committed by GitHub
parent 5a24438698
commit d3d092f65d
20 changed files with 145 additions and 203 deletions

View File

@@ -0,0 +1,23 @@
// Copyright 2026 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package gitcmd
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsStderr(t *testing.T) {
cases := []struct {
check StderrWildcard
stderr string
}{
{StderrUnknownRevisionOrPath, "fatal: ambiguous argument 'origin': unknown revision or path not in the working tree...."},
{StderrNoMergeBase, "fatal: origin/main..HEAD: no merge base...."},
}
for _, tc := range cases {
assert.True(t, IsStderr(&runStdError{stderr: tc.stderr}, tc.check), "stderr: %s", tc.stderr)
}
}