'Pushes the current target branch of the local repository to the origin.
This will only have effect if the local repository exists
and is currently in the target branch.
Args:
repository [string]: The name of the local repository to push from.'

def push_to_origin_if_target_branch(self, repository):

    name = repository.name
    repository_dir = get_repository_dir(name)
    if (not os.path.exists(repository_dir)):
        sys.stderr.write('Skipping    {name}    because    it    does    not    yet    exist.\n'.format(name=name))
        return
    branch = self.get_local_branch_name(name)
    if (branch != self.push_branch):
        sys.stderr.write('Skipping    {name}    because    it    is    in    branch={branch},    not    {want}.\n'.format(name=name, branch=branch, want=self.push_branch))
        return
    print 'Pushing    {name}    to    origin.'.format(name=name)
    check_run_and_monitor('git    -C    "{dir}"    push    origin    {branch}    --tags'.format(dir=repository_dir, branch=self.push_branch), echo=True)
