From 5530e7b7a0c45c82bef1629a3e38298ccb9bf3ec Mon Sep 17 00:00:00 2001 From: mgukov Date: Sun, 26 Feb 2023 15:21:45 +0700 Subject: [PATCH] fix: check if err is NoErrAlreadyUpToDate --- lib/GoGitRepository.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/GoGitRepository.go b/lib/GoGitRepository.go index 5fc2dce7..999c86e0 100644 --- a/lib/GoGitRepository.go +++ b/lib/GoGitRepository.go @@ -142,11 +142,19 @@ func (c GoGitClient) CanBePulled(r GitRepository) bool { return false } - err = rep.Fetch(&git.FetchOptions{}) + authMethod, err := GetAuthMethod(r) if err != nil { return false } + err = rep.Fetch(&git.FetchOptions{ + Auth: authMethod, + }) + + if err != nil && err != git.NoErrAlreadyUpToDate { + return false + } + head, err := rep.Head() if err != nil { return false