|
|
|
@ -1432,12 +1432,11 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
}]
|
|
|
|
|
write('.gclient', 'solutions = %s' % repr(solutions))
|
|
|
|
|
|
|
|
|
|
ls_tree = """160000 commit be8c5114d606692dc783b60cf256690b62fbad17\tfoo/bar
|
|
|
|
|
100644 blob daf2de9caad4a70e6bb1047a6b50c412066f68b1\tREADME.txt
|
|
|
|
|
160000 commit 3ad3b564f8ae456f286446d091709f5a09fa4a93\taaaaaa
|
|
|
|
|
160000 commit 956df937508b65b5e72a4cf02696255be3631b78\ta.a.a/a
|
|
|
|
|
160000 commit b9f77763f0fab67eeeb6371492166567a8b7a3d2\ta_b/c
|
|
|
|
|
160000 commit b9f77763f0fab67eeeb6371492166567a8b7a3d2\ta b/c"""
|
|
|
|
|
ls_files = """160000 be8c5114d606692dc783b60cf256690b62fbad17 0\tfoo/bar
|
|
|
|
|
160000 3ad3b564f8ae456f286446d091709f5a09fa4a93 0\taaaaaa
|
|
|
|
|
160000 956df937508b65b5e72a4cf02696255be3631b78 0\ta.a.a/a
|
|
|
|
|
160000 b9f77763f0fab67eeeb6371492166567a8b7a3d2 0\ta_b/c
|
|
|
|
|
160000 b9f77763f0fab67eeeb6371492166567a8b7a3d2 0\ta b/c"""
|
|
|
|
|
|
|
|
|
|
git_config = """submodule.foo/bar.path=foo/bar
|
|
|
|
|
submodule.foo/bar.url=http://example.com/foo/bar
|
|
|
|
@ -1453,7 +1452,8 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
|
|
|
|
|
os_path_isfile_mock = mock.MagicMock(return_value=True)
|
|
|
|
|
subprocess2_check_output_mock = mock.MagicMock(
|
|
|
|
|
side_effect=[ls_tree.encode(), git_config.encode()])
|
|
|
|
|
side_effect=[git_config.encode(),
|
|
|
|
|
ls_files.encode()])
|
|
|
|
|
|
|
|
|
|
options, _ = gclient.OptionParser().parse_args([])
|
|
|
|
|
client = gclient.GClient.LoadCurrentConfig(options)
|
|
|
|
@ -1498,6 +1498,14 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
'b9f77763f0fab67eeeb6371492166567a8b7a3d2'),
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
subprocess2_check_output_mock.assert_has_calls([
|
|
|
|
|
mock.call(['git', 'config', '--file', mock.ANY, '-l']),
|
|
|
|
|
mock.call([
|
|
|
|
|
'git', 'ls-files', '-s', 'foo/bar', 'aaaaaa', 'a.a.a/a', 'a_b/c',
|
|
|
|
|
'a b/c'
|
|
|
|
|
],
|
|
|
|
|
cwd=mock.ANY)
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
def testParseGitSubmodules_UsesAbsolutePath(self):
|
|
|
|
|
"""ParseGitSubmodules uses absolute path when use_relative_path is not
|
|
|
|
@ -1509,12 +1517,11 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
}]
|
|
|
|
|
write('.gclient', 'solutions = %s' % repr(solutions))
|
|
|
|
|
|
|
|
|
|
ls_tree = """160000 commit be8c5114d606692dc783b60cf256690b62fbad17\tfoo/bar
|
|
|
|
|
100644 blob daf2de9caad4a70e6bb1047a6b50c412066f68b1\tREADME.txt
|
|
|
|
|
160000 commit 3ad3b564f8ae456f286446d091709f5a09fa4a93\taaaaaa
|
|
|
|
|
160000 commit 956df937508b65b5e72a4cf02696255be3631b78\ta.a.a/a
|
|
|
|
|
160000 commit b9f77763f0fab67eeeb6371492166567a8b7a3d2\ta_b/c
|
|
|
|
|
160000 commit b9f77763f0fab67eeeb6371492166567a8b7a3d2\ta b/c"""
|
|
|
|
|
ls_files = """160000 be8c5114d606692dc783b60cf256690b62fbad17 0\tfoo/bar
|
|
|
|
|
160000 3ad3b564f8ae456f286446d091709f5a09fa4a93 0\taaaaaa
|
|
|
|
|
160000 956df937508b65b5e72a4cf02696255be3631b78 0\ta.a.a/a
|
|
|
|
|
160000 b9f77763f0fab67eeeb6371492166567a8b7a3d2 0\ta_b/c
|
|
|
|
|
160000 b9f77763f0fab67eeeb6371492166567a8b7a3d2 0\ta b/c"""
|
|
|
|
|
|
|
|
|
|
git_config = """submodule.foo/bar.path=foo/bar
|
|
|
|
|
submodule.foo/bar.url=http://example.com/foo/bar
|
|
|
|
@ -1530,7 +1537,8 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
|
|
|
|
|
os_path_isfile_mock = mock.MagicMock(return_value=True)
|
|
|
|
|
subprocess2_check_output_mock = mock.MagicMock(
|
|
|
|
|
side_effect=[ls_tree.encode(), git_config.encode()])
|
|
|
|
|
side_effect=[git_config.encode(),
|
|
|
|
|
ls_files.encode()])
|
|
|
|
|
|
|
|
|
|
options, _ = gclient.OptionParser().parse_args([])
|
|
|
|
|
client = gclient.GClient.LoadCurrentConfig(options)
|
|
|
|
@ -1574,6 +1582,14 @@ class GclientTest(trial_dir.TestCase):
|
|
|
|
|
'b9f77763f0fab67eeeb6371492166567a8b7a3d2'),
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
subprocess2_check_output_mock.assert_has_calls([
|
|
|
|
|
mock.call(['git', 'config', '--file', mock.ANY, '-l']),
|
|
|
|
|
mock.call([
|
|
|
|
|
'git', 'ls-files', '-s', 'foo/bar', 'aaaaaa', 'a.a.a/a', 'a_b/c',
|
|
|
|
|
'a b/c'
|
|
|
|
|
],
|
|
|
|
|
cwd=mock.ANY)
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
def testSameDirAllowMultipleCipdDeps(self):
|
|
|
|
|
"""Verifies gclient allow multiple cipd deps under same directory."""
|
|
|
|
|