mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
repo: exit on missing entry point
exit if no repo_main can be found right before executing the command. This happens for instance when 'repo init' is run on root path (for example in a container). Without this counter measure the tool will crash at exec_command with TypeError: sequence item 1: expected str instance, NoneType found Change-Id: Ia8480cfe2151c3b35c9572789ad8cb619288cce1 Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/263457 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@digital.ai>
This commit is contained in:
parent
dd37fb2222
commit
433977e958
4
repo
4
repo
@ -1169,6 +1169,10 @@ def main(orig_args):
|
|||||||
if my_main:
|
if my_main:
|
||||||
repo_main = my_main
|
repo_main = my_main
|
||||||
|
|
||||||
|
if not repo_main:
|
||||||
|
print("fatal: unable to find repo entry point", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
ver_str = '.'.join(map(str, VERSION))
|
ver_str = '.'.join(map(str, VERSION))
|
||||||
me = [sys.executable, repo_main,
|
me = [sys.executable, repo_main,
|
||||||
'--repo-dir=%s' % rel_repo_dir,
|
'--repo-dir=%s' % rel_repo_dir,
|
||||||
|
Loading…
Reference in New Issue
Block a user