mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
This commit is contained in:
parent
954706570c
commit
02b756ef40
4 changed files with 18 additions and 12 deletions
|
|
@ -1,5 +1,8 @@
|
|||
# Changelog
|
||||
|
||||
## v0.8.1 (2018-09-10)
|
||||
- Fix issue where changes were not pulled when tracking a branch (issue #567)
|
||||
|
||||
## v0.8.0 (2018-09-04)
|
||||
|
||||
### Notes about upgrading from v0.7
|
||||
|
|
|
|||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
0.8.0
|
||||
0.8.1
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func (s *Service) ListDir(ctx context.Context, q *ListDirRequest) (*FileList, er
|
|||
return &res, nil
|
||||
}
|
||||
|
||||
err = checkoutRevision(gitClient, q.Revision)
|
||||
err = checkoutRevision(gitClient, commitSHA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -117,7 +117,11 @@ func (s *Service) GetFile(ctx context.Context, q *GetFileRequest) (*GetFileRespo
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = checkoutRevision(gitClient, q.Revision)
|
||||
commitSHA, err := gitClient.LsRemote(q.Revision)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = checkoutRevision(gitClient, commitSHA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -166,7 +170,7 @@ func (s *Service) GenerateManifest(c context.Context, q *ManifestRequest) (*Mani
|
|||
log.Infof("manifest cache miss: %s", cacheKey)
|
||||
}
|
||||
|
||||
err = checkoutRevision(gitClient, q.Revision)
|
||||
err = checkoutRevision(gitClient, commitSHA)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -281,16 +285,12 @@ func IdentifyAppSourceTypeByAppPath(appFilePath string) AppSourceType {
|
|||
}
|
||||
|
||||
// checkoutRevision is a convenience function to initialize a repo, fetch, and checkout a revision
|
||||
func checkoutRevision(gitClient git.Client, revision string) error {
|
||||
func checkoutRevision(gitClient git.Client, commitSHA string) error {
|
||||
err := gitClient.Fetch()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = gitClient.Reset()
|
||||
if err != nil {
|
||||
log.Warn(err)
|
||||
}
|
||||
err = gitClient.Checkout(revision)
|
||||
err = gitClient.Checkout(commitSHA)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ func (m *nativeGitClient) setCredentials() error {
|
|||
func (m *nativeGitClient) Fetch() error {
|
||||
var err error
|
||||
log.Debugf("Fetching repo %s at %s", m.repoURL, m.root)
|
||||
if _, err = m.runCmd("git", "fetch", "origin", "--tags"); err != nil {
|
||||
if _, err = m.runCmd("git", "fetch", "origin", "--tags", "--force"); err != nil {
|
||||
return err
|
||||
}
|
||||
// git fetch does not update the HEAD reference. The following command will update the local
|
||||
|
|
@ -192,7 +192,10 @@ func (m *nativeGitClient) Checkout(revision string) error {
|
|||
if revision == "" || revision == "HEAD" {
|
||||
revision = "origin/HEAD"
|
||||
}
|
||||
if _, err := m.runCmd("git", "checkout", revision); err != nil {
|
||||
if _, err := m.runCmd("git", "checkout", "--force", revision); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := m.runCmd("git", "clean", "-fd"); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue