mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
[gclient_scm] Add new auth stack setup to gclient
Bug: b/356935829 Change-Id: Ie917f142c3fddba398a5351d685a7b131b298a76 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762791 Commit-Queue: Allen Li <ayatane@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -21,8 +21,10 @@ import traceback
|
||||
|
||||
import gclient_utils
|
||||
import gerrit_util
|
||||
import git_auth
|
||||
import git_cache
|
||||
import git_common
|
||||
import newauth
|
||||
import scm
|
||||
import subprocess2
|
||||
|
||||
@@ -1321,6 +1323,10 @@ class GitWrapper(SCMWrapper):
|
||||
parent_dir = os.path.dirname(self.checkout_path)
|
||||
gclient_utils.safe_makedirs(parent_dir)
|
||||
|
||||
# Set up Git authentication configuration that is needed to clone/fetch the repo.
|
||||
if newauth.Enabled():
|
||||
git_auth.ConfigureGlobal('/', url)
|
||||
|
||||
if hasattr(options, 'no_history') and options.no_history:
|
||||
self._Run(['init', self.checkout_path], options, cwd=self._root_dir)
|
||||
self._Run(['remote', 'add', 'origin', url], options)
|
||||
|
||||
Reference in New Issue
Block a user