icyphox / legit

web frontend for git
https://git.icyphox.sh
MIT License
376 stars 25 forks source link

[Feature] Hide ".git" extension from directories. #35

Closed BiRabittoh closed 1 month ago

BiRabittoh commented 2 months ago

This should work seamlessly, without the need to add any additional config options.

Suppose you have the following two repositories:

These are the resulting endpoints:

  1. /repo1 works
  2. /repo1.git does not work
  3. /repo2 works
  4. /repo2.git works

Previously, example no. 3 would not work.

This also hides ".git" extensions from the index page.

icyphox commented 1 month ago

Oh, I just realized this solution breaks if the name is less than 4 chars, lol. My bad, I should've caught that. Pushed a more robust solution here: https://github.com/icyphox/legit/commit/68f08e38aada8d5e8f89679121beef9104430942