From c81db8c596ed909068f2b26879ffcefdb590a51d Mon Sep 17 00:00:00 2001 From: Edward Lemur Date: Fri, 20 Mar 2020 21:56:50 +0000 Subject: [PATCH] git-cl: Remove GetIsGerrit. It's always true. Change-Id: I96a53c032de705724e61c64ee37e9a14b596cbd5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2113250 Reviewed-by: Josip Sokcevic Commit-Queue: Edward Lesmes --- git_cl.py | 11 ----------- tests/git_cl_test.py | 1 - 2 files changed, 12 deletions(-) diff --git a/git_cl.py b/git_cl.py index e7e3253d5..c41d89f16 100755 --- a/git_cl.py +++ b/git_cl.py @@ -832,12 +832,6 @@ class Settings(object): def GetDefaultCCList(self): return self._GetConfig('rietveld.cc') - def GetIsGerrit(self): - """Returns True if this repo is associated with Gerrit.""" - if self.is_gerrit is None: - self.is_gerrit = self._GetConfig('gerrit.host').lower() == 'true' - return self.is_gerrit - def GetSquashGerritUploads(self): """Returns True if uploads to Gerrit should be squashed by default.""" if self.squash_gerrit_uploads is None: @@ -3023,8 +3017,6 @@ def DownloadGerritHook(force): Args: force: True to update hooks. False to install hooks if not present. """ - if not settings.GetIsGerrit(): - return src = 'https://gerrit-review.googlesource.com/tools/hooks/commit-msg' dst = os.path.join(settings.GetRoot(), '.git', 'hooks', 'commit-msg') if not os.access(dst, os.X_OK): @@ -4302,9 +4294,6 @@ def CMDupload(parser, args): if options.use_commit_queue: options.send_mail = True - # For sanity of test expectations, do this otherwise lazy-loading *now*. - settings.GetIsGerrit() - cl = Changelist() # Warm change details cache now to avoid RPCs later, reducing latency for # developers. diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 24242cbb2..0be58475e 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -3453,7 +3453,6 @@ class CMDUploadTestCase(CMDTestCaseBase): mock.patch('git_cl._fetch_tryjobs').start() mock.patch('git_cl._trigger_tryjobs', return_value={}).start() mock.patch('git_cl.Changelist.CMDUpload', return_value=0).start() - mock.patch('git_cl.Settings.GetIsGerrit', return_value=True).start() self.addCleanup(mock.patch.stopall) def testWarmUpChangeDetailCache(self):