mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
fix: check if err is NoErrAlreadyUpToDate
This commit is contained in:
parent
13b2f52c8c
commit
5530e7b7a0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user