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

Change-Id: I7c86b1b19e23da89e60bbb1176a17e0c76863182
This commit is contained in:
Yo Chiang
2020-04-24 07:16:13 +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))