|
@@ -107,6 +107,18 @@ class GitWrapperTestCase(unittest.TestCase):
|
|
|
scm.GIT.GetRemoteHeadRef('foo', 'proto://url', 'origin'))
|
|
|
self.assertEqual(mockCapture.call_count, 1)
|
|
|
|
|
|
+ @mock.patch('scm.GIT.Capture')
|
|
|
+ @mock.patch('os.path.exists', lambda _: True)
|
|
|
+ def testGetRemoteHeadRefLocalUpdateHead(self, mockCapture):
|
|
|
+ mockCapture.side_effect = [
|
|
|
+ 'refs/remotes/origin/master', # first symbolic-ref call
|
|
|
+ 'foo', # set-head call
|
|
|
+ 'refs/remotes/origin/main', # second symbolic-ref call
|
|
|
+ ]
|
|
|
+ self.assertEqual('refs/remotes/origin/main',
|
|
|
+ scm.GIT.GetRemoteHeadRef('foo', 'proto://url', 'origin'))
|
|
|
+ self.assertEqual(mockCapture.call_count, 3)
|
|
|
+
|
|
|
@mock.patch('scm.GIT.Capture')
|
|
|
@mock.patch('os.path.exists', lambda _:True)
|
|
|
def testGetRemoteHeadRefRemote(self, mockCapture):
|