Commit deff57f9 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

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: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
parent 5bdfcd8f
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment