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 raise e
def run(self): 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: try:
self.setup_repo() self.setup_repo()
@ -246,6 +252,8 @@ class GstMRMover:
finally: finally:
if self.git_rename_limit is not None: if self.git_rename_limit is not None:
self.git("config", "merge.renameLimit", str(self.git_rename_limit)) self.git("config", "merge.renameLimit", str(self.git_rename_limit))
if prevbranch:
self.git("checkout", prevbranch)
def fetch_projects(self): def fetch_projects(self):
fprint("Fetching projects... ") fprint("Fetching projects... ")