def _update_repo(repo_config, store, tags_only):
repo_path = store.clone(repo_config['<STR_LIT>'], repo_config['<STR_LIT>'])<EOL>cmd_output('<STR_LIT>', '<STR_LIT>', cwd=repo_path)<EOL>tag_cmd = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>if tags_only:<EOL><INDENT>tag_cmd += ('<STR_LIT>',)<EOL><DEDENT>else:<EOL><INDENT>tag_cmd += ('<STR_LIT>',)<EOL><DEDENT>try:<EOL><INDENT>rev = cmd_output(*tag_cmd, cwd=repo_path)[<NUM_LIT:1>].strip()<EOL><DEDENT>except CalledProcessError:<EOL><INDENT>tag_cmd = ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')<EOL>rev = cmd_output(*tag_cmd, cwd=repo_path)[<NUM_LIT:1>].strip()<EOL><DEDENT>if rev == repo_config['<STR_LIT>']:<EOL><INDENT>return repo_config<EOL><DEDENT>try:<EOL><INDENT>path = store.clone(repo_config['<STR_LIT>'], rev)<EOL>manifest = load_manifest(os.path.join(path, C.MANIFEST_FILE))<EOL><DEDENT>except InvalidManifestError as e:<EOL><INDENT>raise RepositoryCannotBeUpdatedError(six.text_type(e))<EOL><DEDENT>hooks = {hook['<STR_LIT:id>'] for hook in repo_config['<STR_LIT>']}<EOL>hooks_missing = hooks - {hook['<STR_LIT:id>'] for hook in manifest}<EOL>if hooks_missing:<EOL><INDENT>raise RepositoryCannotBeUpdatedError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT:{}>'.format('<STR_LIT:U+002CU+0020>'.join(sorted(hooks_missing))),<EOL>)<EOL><DEDENT>new_config = repo_config.copy()<EOL>new_config['<STR_LIT>'] = rev<EOL>return new_config<EOL>
Updates a repository to the tip of `master`.  If the repository cannot
    be updated because a hook that is configured does not exist in `master`,
    this raises a RepositoryCannotBeUpdatedError

    Args:
        repo_config - A config for a repository