Skip to content

Commit

Permalink
fix: err nil reference
Browse files Browse the repository at this point in the history
  • Loading branch information
seriouspoop committed Sep 4, 2024
1 parent 2e6d2c3 commit 6668d1a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions repo/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (g *Git) Pull(remote *model.Remote, branch model.Branch, auth *config.Crede
Force: false,
})

if strings.Contains(err.Error(), "unable to authenticate") {
if err != nil && strings.Contains(err.Error(), "unable to authenticate") {
return g.err.KeyNotSupported
} else if errors.Is(err, git.ErrNonFastForwardUpdate) {
return g.err.PullFailed
Expand Down Expand Up @@ -261,8 +261,7 @@ func (g *Git) Push(remote *model.Remote, branch model.Branch, auth *config.Crede
Force: true,
Auth: Auth,
})
fmt.Println(err)
if strings.Contains(err.Error(), "unable to authenticate") {
if err != nil && strings.Contains(err.Error(), "unable to authenticate") {
return g.err.KeyNotSupported
} else if errors.Is(err, git.NoErrAlreadyUpToDate) {
return nil
Expand Down

0 comments on commit 6668d1a

Please sign in to comment.