def METHOD_NAME():
    directory = mkdtemp()
    directory = make_git_repo(directory)
    env = environ.copy()
    env["GIT_DIR"] = pjoin(directory, ".git")
    chdir(directory)
    # Add fake repo as submodule. We need to fake this here because local path
    # URL are not allowed and using a real URL will require Internet to clone
    # the repo
    check_output(["git", "checkout", "-b", "submodule", "master"], env=env)
    add_git_submodule_without_cloning(
        directory,
        "foobar",
        "https://foobar.com/git",
    )
    check_output(["git", "add", "."], env=env)
    check_output(["git", "commit", '-m"Add submodule"'], env=env)
    # Add an invalid submodule URL in the invalidsubmodule branch
    check_output(["git", "checkout", "-b", "invalidsubmodule", "master"], env=env)
    add_git_submodule_without_cloning(
        directory,
        "invalid",
        "git@github.com:rtfd/readthedocs.org.git",
    )
    check_output(["git", "add", "."], env=env)
    check_output(["git", "commit", '-m"Add invalid submodule"'], env=env)
    # Checkout to master branch again
    check_output(["git", "checkout", "master"], env=env)
    # Add something unique to the master branch (so we can verify it's correctly checked out)
    open("only-on-default-branch", "w").write(
        "This file only exists in the default branch"
    )
    check_output(["git", "add", "only-on-default-branch"], env=env)
    check_output(
        ["git", "commit", '-m"Add something unique to master branch"'], env=env
    )
    return directory