roll_dep_test: remove file:// scheme in the git url

roll_dep_test is currently using file:///path/to/repo as git url.
Interestingly, the test is not failing in presubmit bot but
failing locally because it is trying to clone using sso protocol
(see: b/391455129#comment11). I think the presubmit bot is not
equipped with git-remote-sso so the tests are able to pass. However,
on a local workstation, git-remote-sso is available but it should
not be used as the file:// scheme should indicate using local
transport protocol. Quoted from
https://git-scm.com/docs/git-clone#_git_urls
> When Git doesn’t know how to handle a certain transport
protocol, it attempts to use the remote-<transport> remote helper,
if one exists.

Removing the file:// scheme appears to fix the issue even though
the only difference is the usage of --local flag according to the
doc.

fwiw, I did try to inject `--local` flag but it gives me a warning
`--local is ignored`. I haven't dig deep enough to figure out why
the flag is ignored.

Bug: 391455129
Change-Id: I8fab9aee5198b2eedfacdb60161197b58f7533ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6313297
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
changes/97/6313297/3
Yiwei Zhang 2 months ago committed by LUCI CQ
parent c4e7c8717c
commit 1221440015

@ -41,7 +41,7 @@ class FakeRepos(fake_repos.FakeReposBase):
'repo_1', {
'DEPS': '\n'.join([
'deps = {',
' "src/foo": "file://%(git_base)srepo_2@%(repo_2_revision)s",',
' "src/foo": "%(git_base)srepo_2@%(repo_2_revision)s",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
@ -71,11 +71,9 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.src_dir = os.path.join(self.root_dir, 'src')
self.foo_dir = os.path.join(self.src_dir, 'foo')
if self.enabled:
self.call([
GCLIENT, 'config', 'file://' + self.git_base + 'repo_1',
'--name', 'src'
],
cwd=self.root_dir)
self.call(
[GCLIENT, 'config', self.git_base + 'repo_1', '--name', 'src'],
cwd=self.root_dir)
self.call([GCLIENT, 'sync'], cwd=self.root_dir)
def call(self, cmd, cwd=None):
@ -110,8 +108,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.assertEqual(self.gitrevparse(self.foo_dir), expected_revision)
self.assertEqual([
'deps = {',
' "src/foo": "file://' + self.git_base.replace('\\', '\\\\') +
'repo_2@' + expected_revision + '",',
' "src/foo": "' + self.git_base.replace('\\', '\\\\') + 'repo_2@' +
expected_revision + '",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
@ -159,8 +157,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.assertEqual(self.gitrevparse(self.foo_dir), expected_revision)
self.assertEqual([
'deps = {',
' "src/foo": "file://' + self.git_base.replace('\\', '\\\\') +
'repo_2@' + expected_revision + '",',
' "src/foo": "' + self.git_base.replace('\\', '\\\\') + 'repo_2@' +
expected_revision + '",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',
@ -191,8 +189,8 @@ class RollDepTest(fake_repos.FakeReposTestBase):
self.assertEqual(self.gitrevparse(self.foo_dir), expected_revision)
self.assertEqual([
'deps = {',
' "src/foo": "file://' + self.git_base.replace('\\', '\\\\') +
'repo_2@' + expected_revision + '",',
' "src/foo": "' + self.git_base.replace('\\', '\\\\') + 'repo_2@' +
expected_revision + '",',
'}',
'hooks = [',
' {"action": ["foo", "--android", "{checkout_android}"]}',

Loading…
Cancel
Save