Skip to content

Make GitRepository.LocalPath nullable so hosting providers need not invent one #82

Description

@matt-edmondson

GitRepository.LocalPath is required and non-nullable, but a repository a hosting provider enumerates has never been cloned, so there is no real local path to report. Both providers work around this by inventing one under Environment.CurrentDirectory.

That has two consequences. The value depends on process-global mutable state, so the same remote repository yields a different record depending on when it was enumerated. And the providers need a containment guard (GitProvider.ToLocalRepositoryPath) purely to make the invented path safe, because the name comes from a remote API response.

A nullable LocalPath would let a provider say "not known", which is what is actually true, and would remove the reason the guard exists at all.

Breaking change, so it belongs in the next major rather than a patch.

Found during the Phase 5b final review (#80).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions