'Pulls the master branch from the upstream repository.
This will only have effect if the local repository exists
and is currently in the master branch.
Args:
repository [string]: The name of the local repository to update.'

def pull_from_upstream_if_master(self, repository):

    name = repository.name
    repository_dir = get_repository_dir(name)
    if (not os.path.exists(repository_dir)):
        self.pull_from_origin(repository)
        if (not os.path.exists(repository_dir)):
            return
    branch = self.get_local_branch_name(name)
    if (branch != 'master'):
        sys.stderr.write('Skipping    {name}    because    it    is    in    branch={branch}.\n'.format(name=name, branch=branch))
        return
    print 'Pulling    master    {name}    from    upstream'.format(name=name)
    check_run_and_monitor('git    -C    "{dir}"    pull    upstream    master    --tags'.format(dir=repository_dir), echo=True)
