Merge "repo_diff: workspace mustn't be in existing tree" am: 36f1452bd4 am: 401bea0161

Change-Id: I85c671b6fd0e7907ccee4cd78508c583c887f7d8
This commit is contained in:
Yo Chiang
2020-04-24 07:26:19 +00:00
committed by Automerger Merge Worker

View File

@@ -68,6 +68,15 @@ def repo_init(url, rev, workspace):
workspace: the folder to init and sync code
"""
try:
subprocess.check_output("repo", stderr=subprocess.PIPE,
cwd=os.path.dirname(workspace), shell=True)
except subprocess.CalledProcessError:
pass
else:
raise ValueError("cannot repo-init workspace (%s), workspace is within an "
"existing tree" % workspace)
print("repo init:\n url: %s\n rev: %s\n workspace: %s" %
(url, rev, workspace))