mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Ensure repo waits for child process to terminate
See http://stackoverflow.com/questions/7004687/os-exec-on-windows: execv on Windows does not behave as on Linux, i.e. a new process is spawned and the parent process terminates right away, which makes the shell prompt come back too soon. Change-Id: I1f8d23208765988629f081e9b949c67cf71c08ae
This commit is contained in:
parent
a24671f661
commit
35d22217a5
4
repo
4
repo
@ -120,6 +120,7 @@ GITC_FS_ROOT_DIR = '/gitc/manifest-rw/'
|
||||
|
||||
import errno
|
||||
import optparse
|
||||
import platform
|
||||
import re
|
||||
import shutil
|
||||
import stat
|
||||
@ -887,6 +888,9 @@ def main(orig_args):
|
||||
me.extend(orig_args)
|
||||
me.extend(extra_args)
|
||||
try:
|
||||
if platform.system() == "Windows":
|
||||
sys.exit(subprocess.call(me))
|
||||
else:
|
||||
os.execv(sys.executable, me)
|
||||
except OSError as e:
|
||||
_print("fatal: unable to start %s" % repo_main, file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user