Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: René Pfeuffer <[email protected]>
  • Loading branch information
pfeuffer committed Jan 7, 2025
1 parent b3de71b commit 2915145
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions applicationset/services/scm_provider/scm-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ func (g *ScmManagerProvider) ListRepos(ctx context.Context, cloneProtocol string
if err != nil {
if errors.Is(err, scmm.ErrEmptyRepository) || errors.Is(err, scmm.ErrNoDefaultBranchFound) {
continue
} else {
return nil, err
}
return nil, err
}

repos = append(repos, &Repository{
Expand Down Expand Up @@ -144,10 +143,10 @@ func (g *ScmManagerProvider) RepoHasPath(ctx context.Context, repo *Repository,
if resp != nil && resp.StatusCode == http.StatusNotFound {
return false, nil
}
if fmt.Sprint(err) == "expect file, got directory" {
return true, nil
}
if err != nil {
if err.Error() == "expect file, got directory" {
return true, nil
}
return false, err
}
return true, nil
Expand Down
2 changes: 1 addition & 1 deletion applicationset/services/scm_provider/scm-manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func scmManagerMockHandler(t *testing.T, repositoryName string) func(http.Respon
handleBranchesRequestWithExistingBranches(t, w)
case "/api/v2/repositories/test-argocd/empty/branches/":
handleBranchesRequestWithoutBranches(t, w)
case fmt.Sprintf("/api/v2/repositories/test-argocd/%s", repositoryName):
case "/api/v2/repositories/test-argocd/" + repositoryName:
handleRepositoryRequest(t, w)
case "/api/v2/repositories/test-argocd/pr-test/content/master/README.md?ref=master":
_, err := io.WriteString(w, `"my readme test"`)
Expand Down

0 comments on commit 2915145

Please sign in to comment.