(self)
| 947 | self.remote = self.repo.remotes['remote'] |
| 948 | |
| 949 | def test_sync_changes(self): |
| 950 | master_head_before = self.remote.lookup_branch('master').head |
| 951 | remote_branch = self.remote.lookup_branch(REMOTE_BRANCH) |
| 952 | remote_branch_head_before = remote_branch.head |
| 953 | |
| 954 | current_b = self.repo.current_branch |
| 955 | # It is not a ff so it should fail |
| 956 | self.assertRaises(core.GlError, current_b.publish, remote_branch) |
| 957 | # Get the changes |
| 958 | git.rebase(remote_branch) |
| 959 | # Retry (this time it should work) |
| 960 | current_b.publish(remote_branch) |
| 961 | |
| 962 | self.assertItemsEqual( |
| 963 | ['master', REMOTE_BRANCH], self.remote.listall_branches()) |
| 964 | self.assertEqual( |
| 965 | master_head_before.id, self.remote.lookup_branch('master').head.id) |
| 966 | |
| 967 | self.assertNotEqual( |
| 968 | remote_branch_head_before.id, |
| 969 | remote_branch.head.id) |
| 970 | self.assertEqual(current_b.head.id, remote_branch.head.id) |
nothing calls this directly
no test coverage detected