Skip to content

Inconsistent behavior between [p]repo add and other commands #6371

@Flame442

Description

@Flame442

What Red version are you using?

3.5.9

Cog name

Downloader

Command name

repo

What happened?

When running [p]repo add, if the name used is the same as an already installed repo but with different casing, the bot says a repo with that name already exists. When running [p]repo del, the correct casing must be used, or the bot will say a repo with that name does not exist. It is confusing that a repo can be stated to exist with one command, but not exist with another. Similar case-sensitive parsing happens with [p]cog install, and likely other commands.

How can we reproduce this error?

  1. [p]repo add test https://github.com/Flame442/FlameCogs
  2. [p]repo add TEST https://github.com/Flame442/FlameCogs -> already exists
  3. [p]repo del TEST https://github.com/Flame442/FlameCogs -> does not exist

Anything else?

Downloader stores repos in folders that should be interpreted case insensitively. The Repo converter should be updated to be able to match an existing repo regardless of the specific casing used.

[p]repo add eventually reaches this function, which checks if the path exists case insensitively, rather than just if the repo exists in ._repos.

def _existing_git_repo(self) -> Tuple[bool, Path]:
git_path = self.folder_path / ".git"
return git_path.exists(), git_path

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category: Cogs - DownloaderThis is related to the Downloader cog.Status: AcceptedWe want thisType: BugUnexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions