'Send branch from local to remote repository and verify it worked.'

def send_and_verify(self, branch, local, target):

    client = LocalGitClient()
    ref_name = ('refs/heads/' + branch)
    new_refs = client.send_pack(target.path, (lambda _: {ref_name: local.refs[ref_name]}), local.object_store.generate_pack_contents)
    self.assertEqual(local.refs[ref_name], new_refs[ref_name])
    obj_local = local.get_object(new_refs[ref_name])
    obj_target = target.get_object(new_refs[ref_name])
    self.assertEqual(obj_local, obj_target)
