Skip to content

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

Open
@PhilTaken

Description

@PhilTaken

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions