<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_repo(task, source_env_prefix):
 """Get the repo for a task. Args: task (ChainOfTrust or LinkOfTrust):
 the trust object to inspect source_env_prefix (str):
 The environment variable prefix that is used to get repository information. Returns: str: the source url. None: if not defined for this task. """

    repo = _extract_from_env_in_payload(task, source_env_prefix + '_HEAD_REPOSITORY')
    if repo is not None:
        repo = repo.rstrip('/')
    return repo