Skip to content

Conversation

tidy-dev
Copy link
Contributor

@tidy-dev tidy-dev commented Aug 21, 2024

Closes #19137

Description

This PR updates our isGitHubRepository method to not incorrectly identify subfolders of a directory as being repositories and block the user from creating a repository out of subdirectory with the "This directory appears to be a Git repository".

Other thoughts:

  • This PR is about unblocking functionality that is available in the git via the command line. But.. if a user is trying to do this, it 1) could be a mistake - it is not common for a user to make a repository in a repository and now as seen in my video below.. maybe a user doesn't realize that the repository is created in a directory at path + name or 2) they really want submodules. This could be an opportunity to instead of showing an error show a "Did you know?" message about submodules and/or a warning..
  1. Should we have something in the footer that says. "This will create the "name" repository at "path/name". That way it is clear that a new directory is being added... I get bit by this often enough. Similarly should the error say "This directory" which being beneath the local path input indicates maybe it is just the local path or should it say "The directory path/name" appears to be a Git directory.

Screenshots

Below we see that github/testing is a repository so if I adding testing to the path. It is now checking if github/testing/testing is a repository which it is not.

CleanShot.2024-08-21.at.11.44.13.mp4

Release notes

Notes: [Fixed] The "Create a New Repository" dialog allows creation of repositories of repository subfolders.

@tidy-dev tidy-dev requested a review from sergiou87 August 21, 2024 15:48
@tidy-dev tidy-dev changed the title Check if the path being checked is the repo found path Check if the path being checked is the create a new repo is actually the suggested new path Aug 21, 2024
Copy link
Member

@sergiou87 sergiou87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! And I agree with both suggestions 🤔

Also thinking if isGitRepository is something that could get unit-tested.

Approving anyway since this chunk of work makes sense, and I'll let you decide how to handle the rest (if you want)

@tidy-dev tidy-dev merged commit f239481 into development Aug 22, 2024
8 checks passed
@tidy-dev tidy-dev deleted the fix-allow-creating-repository-out-of-subdirectory branch August 22, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't create a local repo
2 participants