Skip to content

Commit

Permalink
Change error check
Browse files Browse the repository at this point in the history
Ref: shipwright-io#1765

Change the way to check for the error so that it finds the error in an error chain.

Signed-off-by: Matthias Diester <mddiester@gmail.com>
  • Loading branch information
HeavyWombat authored and SaschaSchwarze0 committed Jan 8, 2025
1 parent c2aa39b commit fce081d
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 fce081d

Please sign in to comment.