Skip to content
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

.git suffix inconsistently enforced #101

Open
willstott101 opened this issue Feb 21, 2022 · 1 comment
Open

.git suffix inconsistently enforced #101

willstott101 opened this issue Feb 21, 2022 · 1 comment

Comments

@willstott101
Copy link
Contributor

willstott101 commented Feb 21, 2022

When creating a new repo, a .git suffix is appended here:

if (!/\.git$/.test(repo)) repo += '.git';
and it appears to be enforced in list, but not everywhere

However the .git suffix is not a requirement anywhere else - this server is perfectly happy serving git repositories without a .git suffix afaict...

return repo.slice(0, locationOfGit > 0 ? locationOfGit : repo.length);

This inconsistency has tripped me up a bit. I would personally be in favour of enforcing a .git suffix everywhere - possibly by redirecting to .git suffixed URL if a non-git suffixed URL is encountered.

This is inconsistent with bare/checked-out repo conventions though... which might suggest to enforce .git only if checkout is false...

I think for us we're going to enforce and stick to the suffix externally for the meantime - but it'd be good to gather opinions of other maintainers/users.

@gabrielcsapo
Copy link
Owner

I agree, we could make this an option that could be "enforceGitSuffix"? Thoughts on what it would look like for opt-in behavior?

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

No branches or pull requests

2 participants