Skip to content

Commit 9d0cee8

Browse files
committed
fix lint
1 parent 647c282 commit 9d0cee8

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

integrations/api_repo_get_contents_list_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313
"code.gitea.io/gitea/models"
1414
"code.gitea.io/gitea/modules/context"
1515
"code.gitea.io/gitea/modules/git"
16+
repo_module "code.gitea.io/gitea/modules/repository"
1617
"code.gitea.io/gitea/modules/setting"
1718
api "code.gitea.io/gitea/modules/structs"
18-
repo_module "code.gitea.io/gitea/modules/repository"
1919

2020
"github.com/stretchr/testify/assert"
2121
)
@@ -72,15 +72,18 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
7272

7373
// Make a new branch in repo1
7474
newBranch := "test_branch"
75-
repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
75+
err := repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
76+
assert.NoError(t, err)
7677
// Get the commit ID of the default branch
77-
gitRepo, _ := git.OpenRepository(repo1.RepoPath())
78+
gitRepo, err := git.OpenRepository(repo1.RepoPath())
79+
assert.NoError(t, err)
7880
defer gitRepo.Close()
7981

8082
commitID, _ := gitRepo.GetBranchCommitID(repo1.DefaultBranch)
8183
// Make a new tag in repo1
8284
newTag := "test_tag"
83-
gitRepo.CreateTag(newTag, commitID)
85+
err = gitRepo.CreateTag(newTag, commitID)
86+
assert.NoError(t, err)
8487
/*** END SETUP ***/
8588

8689
// ref is default ref

integrations/api_repo_get_contents_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,19 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
7373

7474
// Make a new branch in repo1
7575
newBranch := "test_branch"
76-
repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
76+
err := repo_module.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
77+
assert.NoError(t, err)
7778
// Get the commit ID of the default branch
78-
gitRepo, _ := git.OpenRepository(repo1.RepoPath())
79+
gitRepo, err := git.OpenRepository(repo1.RepoPath())
80+
assert.NoError(t, err)
7981
defer gitRepo.Close()
8082

81-
commitID, _ := gitRepo.GetBranchCommitID(repo1.DefaultBranch)
83+
commitID, err := gitRepo.GetBranchCommitID(repo1.DefaultBranch)
84+
assert.NoError(t, err)
8285
// Make a new tag in repo1
8386
newTag := "test_tag"
84-
gitRepo.CreateTag(newTag, commitID)
87+
err = gitRepo.CreateTag(newTag, commitID)
88+
assert.NoError(t, err)
8589
/*** END SETUP ***/
8690

8791
// ref is default ref

0 commit comments

Comments
 (0)