def METHOD_NAME(repo, extensions, excludes=[""]):
    repo.remotes.origin.fetch("+refs/heads/master:refs/remotes/origin/master", no_tags=True)
    mb = repo.merge_base(repo.head, repo.remotes.origin.refs.master)[0]
    wdir = pathlib.Path(repo.working_dir)
    relevantFiles = set()
    for i in mb.diff(repo.head):
        relevantFiles.add(wdir / i.a_path)
        relevantFiles.add(wdir / i.b_path)
    return (pathlib.Path(f) for f in relevantFiles
            if any(f.match(ext) for ext in extensions)
            and not any(fnmatch.fnmatch(f, x) for x in excludes)
            and f.exists())