move-mrs-script: Get back to checked out branch

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/919>
This commit is contained in:
Thibault Saunier 2021-09-26 19:37:07 -03:00 committed by GStreamer Marge Bot
parent 6d2f033dbb
commit c722bedf1d

View file

@ -236,6 +236,12 @@ class GstMRMover:
raise e
def run(self):
try:
prevbranch = self.git("rev-parse", "--abbrev-ref", "HEAD", can_fail=True).strip()
except:
fprint(bold(yellow("Not on a branch?\n")), indent=False)
prevbranch = None
try:
self.setup_repo()
@ -246,6 +252,8 @@ class GstMRMover:
finally:
if self.git_rename_limit is not None:
self.git("config", "merge.renameLimit", str(self.git_rename_limit))
if prevbranch:
self.git("checkout", prevbranch)
def fetch_projects(self):
fprint("Fetching projects... ")