diff --git a/scm.py b/scm.py index ee9102510..85033937e 100644 --- a/scm.py +++ b/scm.py @@ -385,7 +385,7 @@ class GIT(object): command = ['-c', 'core.quotePath=false', 'ls-files', '-s', '--', '.'] files = GIT.Capture(command, cwd=cwd).splitlines(False) # return only files - return [f.split(maxsplit=4)[-1] for f in files if f.startswith('100')] + return [f.split(maxsplit=3)[-1] for f in files if f.startswith('100')] @staticmethod def GetPatchName(cwd): diff --git a/testing_support/fake_repos.py b/testing_support/fake_repos.py index 72bab68f2..31c5a3d27 100755 --- a/testing_support/fake_repos.py +++ b/testing_support/fake_repos.py @@ -233,8 +233,10 @@ class FakeRepos(FakeReposBase): 'origin': 'git/repo_3@2\n', }) - self._commit_git('repo_1', { - 'DEPS': """ + self._commit_git( + 'repo_1', + { + 'DEPS': """ vars = { 'DummyVariable': 'repo', 'false_var': False, @@ -272,15 +274,16 @@ deps_os = { 'src/repo4': '/repo_4', }, }""" % { - 'git_base': self.git_base, - # See self.__init__() for the format. Grab's the hash of the first - # commit in repo_2. Only keep the first 7 character because of: - # TODO(maruel): http://crosbug.com/3591 We need to strip the hash.. - # duh. - 'hash3': self.git_hashes['repo_3'][1][0][:7] - }, - 'origin': 'git/repo_1@1\n', - }) + 'git_base': self.git_base, + # See self.__init__() for the format. Grab's the hash of the + # first commit in repo_2. Only keep the first 7 character + # because of: TODO(maruel): http://crosbug.com/3591 We need to + # strip the hash.. duh. + 'hash3': self.git_hashes['repo_3'][1][0][:7] + }, + 'origin': 'git/repo_1@1\n', + 'foo bar': 'some file with a space', + }) self._commit_git('repo_2', { 'origin': 'git/repo_2@1\n', diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py index 52d560d3c..661a9f3d0 100755 --- a/tests/scm_unittest.py +++ b/tests/scm_unittest.py @@ -170,7 +170,8 @@ class RealGitTest(fake_repos.FakeReposTestBase): self.assertFalse(scm.GIT.IsAncestor(self.githash('repo_1', 1), 'zebra')) def testGetAllFiles(self): - self.assertEqual(['DEPS','origin'], scm.GIT.GetAllFiles(self.cwd)) + self.assertEqual(['DEPS', 'foo bar', 'origin'], + scm.GIT.GetAllFiles(self.cwd)) def testGetSetConfig(self): key = 'scm.test-key'