Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Support hierarchical (with owner) or flat repository directory layout #2430

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

jcansdale
Copy link
Collaborator

@jcansdale jcansdale commented Oct 17, 2019

Remember the repository directory and layout after a user clones a repository. This mirrors a similar feature which has been used for a long time in GitHub Desktop. It means users don't need to discover the default clone location directory option.

What this PR does

  • Infer and store the default clone directory after cloning
  • Infer and store the default directory layout after cloning (flat or owner/repositoryName)
  • Fix broken PackageSettingsGen.tt file

Inferring Directory Layout

  • If a user clones https://github.com/jcansdale/repo_name into C:\Source\GitHub\repo_name, infer a default directory of C:\Source\GitHub and a flat directory layout
  • If a user clones https://github.com/jcansdale/repo_name into C:\Source\GitHub\jcansdale\repo_name, infer a default directory of C:\Source\GitHub and a directory layout that includes the repository owner
  • Update the name or owner/name component of the local path whenever a different repository is selected (or edited)

How to test

...

Fixes #2428

jcansdale and others added 24 commits October 15, 2019 15:28
Adds DefaultRepositoryLocation and DefaultRepositoryLayout
Make RepositoryCloneService responsible for storing the default clone
path and deciding on the default clone path for a given repository URL.
Factor out RepositoryLayout related logic into
RepositoryLayoutUtilities.
Make sure unknown layouts don't throw.
When users clone into a directory with the same name as the repository
owner, expect the case of the owner to match.

This avoids a false positive when cloning a repository from the "github"
organization into a direcotry called "GitHub". This is the default directory
that GitHub Desktop uses and could be very anoying.
When remembering the default clone directory, use same capitalization
as underlying sile system.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Be more flexible about the repository folder layout when opening from GitHub
1 participant