Skip to content

Commit

Permalink
Merge pull request #1766 from shipwright-io/refactor/error-check
Browse files Browse the repository at this point in the history
Change error check in `pkg/git`
  • Loading branch information
openshift-merge-bot[bot] authored Jan 4, 2025
2 parents 6a74c8c + 9e49d37 commit 3b6facd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package git

import (
"context"
"errors"
"fmt"

"github.com/go-git/go-git/v5/config"
Expand Down Expand Up @@ -45,7 +46,7 @@ func ValidateGitURLExists(ctx context.Context, urlPath string) error {
// path doesn't exist, func will return `authentication required`,
// this is maybe misleading. So convert this error message to:
// `remote repository unreachable`
if err == transport.ErrAuthenticationRequired {
if errors.Is(err, transport.ErrAuthenticationRequired) {
return fmt.Errorf("remote repository unreachable")
}

Expand Down

0 comments on commit 3b6facd

Please sign in to comment.