From a9467d8216950a1238f9eba9e67c60144309caff Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Thu, 9 Jun 2022 22:05:43 +0000 Subject: [PATCH] Remove duplicate sparse-checkout call. Bug:1330629 Change-Id: Ieccf72c75dda7cbec473fcfa07d25fb59f8eb7c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3689728 Commit-Queue: Joanna Wang Reviewed-by: Josip Sokcevic Reviewed-by: Aravind Vasudevan --- gclient_scm.py | 6 ------ tests/gclient_scm_test.py | 22 +++++++--------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index 8eb8ce864..76507e410 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -1104,12 +1104,6 @@ class GitWrapper(SCMWrapper): retry=True, print_stdout=print_stdout, filter_fn=filter_fn) - self._Run(['-C', self.checkout_path, 'sparse-checkout', 'reapply'], - options, - cwd=self._root_dir, - retry=True, - print_stdout=print_stdout, - filter_fn=filter_fn) except: traceback.print_exc(file=self.out_fh) raise diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py index 42222311d..8185b41ef 100755 --- a/tests/gclient_scm_test.py +++ b/tests/gclient_scm_test.py @@ -238,21 +238,13 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase): options = self.Options() scm = gclient_scm.GitWrapper(self.url, self.root_dir, self.relpath) scm._Clone('123123ab', self.url, options) - self.assertEquals(mockRun.mock_calls, [ - mock.call( - ['citc', 'clone-repo', self.url, scm.checkout_path, '123123ab'], - options, - cwd=scm._root_dir, - retry=True, - print_stdout=False, - filter_fn=scm.filter), - mock.call(['-C', scm.checkout_path, 'sparse-checkout', 'reapply'], - options, - cwd=scm._root_dir, - retry=True, - print_stdout=False, - filter_fn=scm.filter), - ]) + mockRun.assert_called_once_with( + ['citc', 'clone-repo', self.url, scm.checkout_path, '123123ab'], + options, + cwd=scm._root_dir, + retry=True, + print_stdout=False, + filter_fn=scm.filter) mockSetFetchConfig.assert_called_once() mockGetCurrentBranch.assert_called_once()