Skip to content

Fix: Fixed issue where repository names lost casing and retained .git suffix #17421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 10, 2025

Conversation

marcofranzen99
Copy link
Contributor

Resolved / Related Issues

Steps used to test these changes

  1. Used the clone action from the command palette (or drag and drop the URL)
  2. Pasted url https://github.com/files-community/Files.git or https://github.com/files-community/Files
  3. Verified that casing was preserved (uppercase F) and the .git suffix was removed.
image image

keep casing + remove .git suffix if present
@yaira2 yaira2 self-requested a review August 10, 2025 14:08
@yaira2
Copy link
Member

yaira2 commented Aug 10, 2025

These changes appear to block the ability to drag URLs like https://github.com/files-community/Files/pull/17421. The feature was initially implemented to support dragging URLs even if they weren't the root of the repo.

@yaira2 yaira2 added changes requested Changes are needed for this pull request and removed needs - code review labels Aug 10, 2025
@marcofranzen99
Copy link
Contributor Author

These changes appear to block the ability to drag URLs like https://github.com/files-community/Files/pull/17421. The feature was initially implemented to support dragging URLs even if they weren't the root of the repo.

Good point, I didn't know that feature exists.
I have adjusted the regex so that the URL doesn't have to end with the repo name or a slash. Everything after the repo name gets ignored now

image

I think it would be useful to add a unit test for the IsValidRepoUrl method, for example. Since there is no UnitTests project, I left it out for now. What do you think of this?

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 changed the title Fix: Fixed bug where repository names lost casing or kept .git Fix: Fixed issue where repository names lost casing and retained .git suffix Aug 10, 2025
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed changes requested Changes are needed for this pull request labels Aug 10, 2025
@yaira2 yaira2 merged commit 6cbbeb8 into files-community:main Aug 10, 2025
6 checks passed
@yaira2
Copy link
Member

yaira2 commented Aug 10, 2025

I think it would be useful to add a unit test for the IsValidRepoUrl method, for example. Since there is no UnitTests project, I left it out for now. What do you think of this?

It would be helpful 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Git repository directory name contains .git suffix
2 participants