mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-23 01:08:33 +00:00
fix: improve fetching commit SHAs (#5312)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This commit is contained in:
parent
dbadd74b42
commit
d8b545d107
1 changed files with 3 additions and 2 deletions
|
|
@ -263,8 +263,9 @@ func (m *nativeGitClient) IsLFSEnabled() bool {
|
|||
// Fetch fetches latest updates from origin
|
||||
func (m *nativeGitClient) Fetch(revision string) error {
|
||||
var err error
|
||||
if revision != "" {
|
||||
err = m.runCredentialedCmd("git", "fetch", "origin", revision)
|
||||
// Some git providers don't support fetching commit sha
|
||||
if revision != "" && !IsCommitSHA(revision) && !IsTruncatedCommitSHA(revision) {
|
||||
err = m.runCredentialedCmd("git", "fetch", "origin", revision, "--tags", "--force")
|
||||
} else {
|
||||
err = m.runCredentialedCmd("git", "fetch", "origin", "--tags", "--force")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue