fail if fetch command is called in Cog

Bug: 345486495
Change-Id: I858a4041b54049cc52cf1a15f0aed461f3ddf985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5606279
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
changes/79/5606279/2
Yiwei Zhang 11 months ago committed by LUCI CQ
parent b7b7718b47
commit aa89e07e15

@ -24,6 +24,7 @@ import shlex
import subprocess
import sys
import gclient_utils
import git_common
from distutils import spawn
@ -270,6 +271,12 @@ def run(options, spec, root):
method (checkout type, repository url, etc.).
root: The directory into which the repo expects to be checkout out.
"""
if gclient_utils.IsEnvCog():
print(
'Your current directory appears to be in a Cog workspace.'
'"fetch" command is not supported in this environment.',
file=sys.stderr)
return 1
assert 'type' in spec
checkout_type = spec['type']
checkout_spec = spec['%s_spec' % checkout_type]

Loading…
Cancel
Save