'Pulls the current branch from the git origin.
Args:
repository [string]: The local repository to update.'

def pull_from_origin(self, repository):

    name = repository.name
    repository_dir = get_repository_dir(name)
    if (not os.path.exists(repository_dir)):
        self.git_clone(repository)
        return
    print 'Updating    {name}    from    origin'.format(name=name)
    branch = self.get_local_branch_name(name)
    if (branch != self.pull_branch):
        if self.__options.force_pull:
            sys.stderr.write('WARNING:    Updating    {name}    branch={branch},    *NOT*    "{want}"\n'.format(name=name, branch=branch, want=self.pull_branch))
        else:
            sys.stderr.write('WARNING:    Skipping    {name}    because    branch={branch},    *NOT*    "{want}"\n'.format(name=name, branch=branch, want=self.pull_branch))
            return
    try:
        check_run_and_monitor('git    -C    "{dir}"    pull    origin    {branch}    --tags'.format(dir=repository_dir, branch=branch), echo=True)
    except RuntimeError:
        result = check_run_and_monitor('git    -C    "{dir}"    branch    -r'.format(dir=repository_dir), echo=False)
        if (result.stdout.find('origin/{branch}\n') >= 0):
            raise
        sys.stderr.write('WARNING    {name}    branch={branch}    is    not    known    to    the    origin.\n'.format(name=name, branch=branch))
