diff options
author | Stephen Solka <solka@hey.com> | 2020-07-19 05:53:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 12:53:40 +0300 |
commit | 54513452a1134de670467e5a8d5cebd768b3c7e4 (patch) | |
tree | 48e39d2e52daa88cf93431dd6b0642e482a5e018 /integrations/repofiles_update_test.go | |
parent | b609a25014cf732ec444c132dc9fb892818281dc (diff) | |
download | gitea-54513452a1134de670467e5a8d5cebd768b3c7e4.tar.gz gitea-54513452a1134de670467e5a8d5cebd768b3c7e4.zip |
prefer NoError/Error over Nil/NotNil (#12271)
Diffstat (limited to 'integrations/repofiles_update_test.go')
-rw-r--r-- | integrations/repofiles_update_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/integrations/repofiles_update_test.go b/integrations/repofiles_update_test.go index c422483bf8..9e99b36ae4 100644 --- a/integrations/repofiles_update_test.go +++ b/integrations/repofiles_update_test.go @@ -201,7 +201,7 @@ func TestCreateOrUpdateRepoFileForCreate(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -237,7 +237,7 @@ func TestCreateOrUpdateRepoFileForUpdate(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -272,7 +272,7 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() @@ -287,7 +287,7 @@ func TestCreateOrUpdateRepoFileForUpdateWithFileMove(t *testing.T) { t.Fatalf("expected git.ErrNotExist, got:%v", err) } toEntry, err := commit.GetTreeEntryByPath(opts.TreePath) - assert.Nil(t, err) + assert.NoError(t, err) assert.Nil(t, fromEntry) // Should no longer exist here assert.NotNil(t, toEntry) // Should exist here // assert SHA has remained the same but paths use the new file name @@ -322,7 +322,7 @@ func TestCreateOrUpdateRepoFileWithoutBranchNames(t *testing.T) { fileResponse, err := repofiles.CreateOrUpdateRepoFile(repo, doer, opts) // asserts - assert.Nil(t, err) + assert.NoError(t, err) gitRepo, _ := git.OpenRepository(repo.RepoPath()) defer gitRepo.Close() |