Files
gitea/modules/git/gitcmd/error_test.go
wxiaoguang d3d092f65d chore: fix git commit "rev-list" (#38069)
Fix the copied & pasted messy code, fix #38067

Now, "limit=-1" means "no limit"
2026-06-11 18:08:55 +00:00

24 lines
594 B
Go

// 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)
}
}