Fix prefetch release branch

This commit is contained in:
Mikhail f. Shiryaev 2022-05-19 10:05:34 +02:00
parent 16c8e93dd0
commit 3d0e4c56e2
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -165,7 +165,10 @@ class Release:
)
# Prefetch the branch to have it updated
self.run(f"git fetch {self.repo.url} {branch}:{branch}")
if self._git.branch == branch:
self.run("git pull")
else:
self.run(f"git fetch {self.repo.url} {branch}:{branch}")
output = self.run(f"git branch --contains={self.release_commit} {branch}")
if branch not in output:
raise Exception(