mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Default fetch to sso:// within cog
This CL makes fetch default to sso:// within the cog env. It also adds a helper within gclient_scm to check if the env is cog. Bug: chrome-operations:170 Change-Id: I8c35348653406549fadbd08df3d9991bb24ca776 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3670721 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Joanna Wang <jojwang@chromium.org> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This commit is contained in:
committed by
LUCI CQ
parent
2a229719c2
commit
14e6d235f2
5
fetch.py
5
fetch.py
@@ -260,6 +260,11 @@ def run(options, spec, root):
|
||||
checkout_type = spec['type']
|
||||
checkout_spec = spec['%s_spec' % checkout_type]
|
||||
|
||||
# Use sso:// by default if the env is cog
|
||||
if not options.protocol_override and \
|
||||
os.getcwd().startswith('/google/src/cloud'):
|
||||
options.protocol_override = 'sso'
|
||||
|
||||
# Replace https using the protocol specified in --protocol-override
|
||||
if options.protocol_override is not None:
|
||||
for solution in checkout_spec['solutions']:
|
||||
|
||||
@@ -208,6 +208,16 @@ class GitWrapper(SCMWrapper):
|
||||
name = 'git'
|
||||
remote = 'origin'
|
||||
|
||||
_is_env_cog = None
|
||||
|
||||
@staticmethod
|
||||
def _IsCog():
|
||||
"""Returns true if the env is cog"""
|
||||
if not GitWrapper._is_env_cog:
|
||||
GitWrapper._is_env_cog = os.getcwd().startswith('/google/src/cloud')
|
||||
|
||||
return GitWrapper._is_env_cog
|
||||
|
||||
@property
|
||||
def cache_dir(self):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user