update_manager: reset to correct commit after recovery

If a git repo not configured on the dev channel it is necessary
to move the HEAD to the commit for the correct tag.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-07-03 20:27:37 -04:00
parent 41d945803f
commit 69710e10e0
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 10 additions and 0 deletions

View File

@ -103,6 +103,16 @@ class GitDeploy(AppDeploy):
dep_info = await self._collect_dependency_info()
if hard:
await self.repo.clone()
if self.channel != Channel.DEV:
if self.repo.upstream_commit != "?":
# If on beta or stable reset to the latest tagged
# upstream commit
await self.repo.reset()
else:
self.notify_status(
f"No upstream commit for repo on {self.channel} channel, "
"skipping reset."
)
await self._update_repo_state()
else:
self.notify_status("Resetting Git Repo...")