Skip to content

Commit 28f091d

Browse files
committed
use require for errors
1 parent 2bea40d commit 28f091d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/integration/git_helper_for_declarative_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"code.gitea.io/gitea/tests"
2424

2525
"github.com/stretchr/testify/assert"
26+
"github.com/stretchr/testify/require"
2627
)
2728

2829
func withKeyFile(t *testing.T, keyname string, callback func(string)) {
@@ -171,13 +172,13 @@ func doGitCheckoutWriteFileCommit(opts localGitAddCommitOptions) func(*testing.T
171172
return func(t *testing.T) {
172173
doGitCheckoutBranch(opts.LocalRepoPath, opts.CheckoutBranch)(t)
173174
localFilePath := filepath.Join(opts.LocalRepoPath, opts.TreeFilePath)
174-
assert.NoError(t, os.WriteFile(localFilePath, []byte(opts.TreeFileContent), 0o644))
175-
assert.NoError(t, git.AddChanges(t.Context(), opts.LocalRepoPath, true))
175+
require.NoError(t, os.WriteFile(localFilePath, []byte(opts.TreeFileContent), 0o644))
176+
require.NoError(t, git.AddChanges(t.Context(), opts.LocalRepoPath, true))
176177
signature := git.Signature{
177178
178179
Name: "test",
179180
}
180-
assert.NoError(t, git.CommitChanges(t.Context(), opts.LocalRepoPath, git.CommitChangesOptions{
181+
require.NoError(t, git.CommitChanges(t.Context(), opts.LocalRepoPath, git.CommitChangesOptions{
181182
Committer: &signature,
182183
Author: &signature,
183184
Message: fmt.Sprintf("update %s @ %s", opts.TreeFilePath, opts.CheckoutBranch),

0 commit comments

Comments
 (0)