Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitCheckout not convergent if checked into specific branch previously, then deployed with specific rev #468

Open
PhilTaken opened this issue Aug 29, 2024 · 0 comments
Assignees

Comments

@PhilTaken
Copy link
Member

Due to

self.cmd(self.expand("git reset --hard {{component.revision}}"))

a checked-out branch on the deploy target will be retained (just moving it's pointer around), leading

return "Your branch is ahead of" in stdout

and/or

stdout, stderr = self.cmd("git fetch --dry-run")

to trigger a false positive UpdateNeeded() if the provided and reset-to rev diverges from the previously checked out branch's remote.

Because the repository is also never checked out to a detached head (as it probably should be when provided with just a rev), the prediction will never converge.

The problem can be resolved manually be checking out a detached head. After that, the above reset --hard to a specific rev will move HEAD as intended and the checks for incoming and outgoing changes will pass, leading to a convergent prediction.

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

No branches or pull requests

2 participants