mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
checkupdates: remove duplicate push in push_commits()
This commit is contained in:
parent
17c480d299
commit
20ff302e89
2 changed files with 5 additions and 4 deletions
|
@ -739,9 +739,6 @@ def push_commits(remote_name='origin', branch_name='checkupdates', verbose=False
|
||||||
|
|
||||||
git_repo.create_head(branch_name, force=True)
|
git_repo.create_head(branch_name, force=True)
|
||||||
remote = git_repo.remotes[remote_name]
|
remote = git_repo.remotes[remote_name]
|
||||||
pushinfos = remote.push(
|
|
||||||
branch_name, force=True, set_upstream=True, progress=progress
|
|
||||||
)
|
|
||||||
pushinfos = remote.push(
|
pushinfos = remote.push(
|
||||||
branch_name,
|
branch_name,
|
||||||
progress=progress,
|
progress=progress,
|
||||||
|
|
|
@ -464,10 +464,13 @@ class CheckupdatesTest(unittest.TestCase):
|
||||||
self.assertTrue(branch in ('main', 'master'))
|
self.assertTrue(branch in ('main', 'master'))
|
||||||
self.assertTrue(branch in repo.heads)
|
self.assertTrue(branch in repo.heads)
|
||||||
|
|
||||||
|
@mock.patch('git.remote.Remote.push')
|
||||||
@mock.patch('sys.exit')
|
@mock.patch('sys.exit')
|
||||||
@mock.patch('fdroidserver.common.read_app_args')
|
@mock.patch('fdroidserver.common.read_app_args')
|
||||||
@mock.patch('fdroidserver.checkupdates.checkupdates_app')
|
@mock.patch('fdroidserver.checkupdates.checkupdates_app')
|
||||||
def test_merge_requests_branch(self, checkupdates_app, read_app_args, sys_exit):
|
def test_merge_requests_branch(
|
||||||
|
self, checkupdates_app, read_app_args, sys_exit, push
|
||||||
|
):
|
||||||
def _sys_exit(return_code=0):
|
def _sys_exit(return_code=0):
|
||||||
self.assertEqual(return_code, 0)
|
self.assertEqual(return_code, 0)
|
||||||
|
|
||||||
|
@ -499,5 +502,6 @@ class CheckupdatesTest(unittest.TestCase):
|
||||||
self.assertNotIn(appid, git_repo.heads)
|
self.assertNotIn(appid, git_repo.heads)
|
||||||
with mock.patch('sys.argv', ['fdroid checkupdates', '--merge-request', appid]):
|
with mock.patch('sys.argv', ['fdroid checkupdates', '--merge-request', appid]):
|
||||||
fdroidserver.checkupdates.main()
|
fdroidserver.checkupdates.main()
|
||||||
|
push.assert_called_once()
|
||||||
sys_exit.assert_called_once()
|
sys_exit.assert_called_once()
|
||||||
self.assertIn(appid, git_repo.heads)
|
self.assertIn(appid, git_repo.heads)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue