From b78aa8f9e98c01d7be87fcb1cbcbea2ba33fb84a Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 7 Oct 2023 03:09:44 +0530 Subject: msubprojects: Abort the rebase if there's conflicts Don't leave the subproject tree in a broken / conflicting state. The user is most likely not a git expert who will know what magic command to run to fix their source tree. --- mesonbuild/msubprojects.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index 45b711d13..87905deb4 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -231,7 +231,9 @@ class Runner: try: self.git_output(['-c', 'rebase.autoStash=true', 'rebase', 'FETCH_HEAD']) except GitException as e: - self.log(' -> Could not rebase', mlog.bold(self.repo_dir), 'onto', mlog.bold(revision)) + self.git_output(['-c', 'rebase.autoStash=true', 'rebase', '--abort']) + self.log(' -> Could not rebase', mlog.bold(self.repo_dir), 'onto', mlog.bold(revision), + '-- aborted') self.log(mlog.red(e.output)) self.log(mlog.red(str(e))) return False -- cgit v1.2.3