aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmesonbuild/msubprojects.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py
index 091f1eb..61ba3a4 100755
--- a/mesonbuild/msubprojects.py
+++ b/mesonbuild/msubprojects.py
@@ -249,9 +249,10 @@ class Runner:
return True
def git_checkout(self, revision: str, create: bool = False) -> bool:
- cmd = ['checkout', '--ignore-other-worktrees', revision, '--']
+ cmd = ['checkout', '--ignore-other-worktrees']
if create:
- cmd.insert(1, '-b')
+ cmd.append('-b')
+ cmd += [revision, '--']
try:
# Stash local changes, commits can always be found back in reflog, to
# avoid any data lost by mistake.