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>
diff --git a/fetch.py b/fetch.py
index 0320207..522639f 100755
--- a/fetch.py
+++ b/fetch.py
@@ -260,6 +260,11 @@
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']: