Add unit tests for guessing main as upstream

R=ehmaldonado@chromium.org

Bug: 1143724
Change-Id: I69ce296a27b36c1073999f2b3c51421ac94e7ef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2519254
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
changes/54/2519254/3
Josip Sokcevic 5 years ago committed by LUCI CQ
parent 5bdfcd8f33
commit deff57f9b2

@ -185,6 +185,12 @@ class RealGitTest(fake_repos.FakeReposTestBase):
self.assertEqual(
('origin', 'refs/heads/master'), scm.GIT.FetchUpstreamTuple(self.cwd))
@mock.patch('scm.GIT.GetRemoteBranches',
return_value=['origin/master', 'origin/main'])
def testFetchUpstreamTuple_GuessOriginMain(self, _mockGetRemoteBranches):
self.assertEqual(('origin', 'refs/heads/main'),
scm.GIT.FetchUpstreamTuple(self.cwd))
def testFetchUpstreamTuple_RietveldUpstreamConfig(self):
scm.GIT.SetConfig(self.cwd, 'rietveld.upstream-branch', 'rietveld-upstream')
scm.GIT.SetConfig(self.cwd, 'rietveld.upstream-remote', 'rietveld-remote')

Loading…
Cancel
Save