Skip to content

Fix issue where branch checkout did not have accurate git tree state (issue #567)#569

Merged
jessesuen merged 1 commit intoargoproj:masterfrom
jessesuen:fix-branch-checkout
Sep 10, 2018
Merged

Fix issue where branch checkout did not have accurate git tree state (issue #567)#569
jessesuen merged 1 commit intoargoproj:masterfrom
jessesuen:fix-branch-checkout

Conversation

@jessesuen
Copy link
Member

@jessesuen jessesuen commented Sep 9, 2018

This change refactors the checkout logic such that git checkout always checks out an explicit git commit SHA, instead of an ambiguous ref name. This is possible because we always perform a git ls-remote to resolve to a SHA-1, which we can then pass to the checkout method.

A second benefit of this approach is that the checkout always is performed in a detached HEAD mode, which leaves the git repository in a state where it never has any local branches. This negates the need to "reset" our git repository (and delete local branches) as part of every repo server call.

@jessesuen jessesuen requested a review from alexmt September 9, 2018 01:56
@jessesuen jessesuen merged commit 02b756e into argoproj:master Sep 10, 2018
leoluz pushed a commit to leoluz/argo-cd that referenced this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants