fix: check if err is NoErrAlreadyUpToDate

This commit is contained in:
mgukov 2023-02-26 15:21:45 +07:00
parent 13b2f52c8c
commit 5530e7b7a0

View File

@ -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