Fix edit link when base URL has a path

On a setup having a path prefix such as `/r` the edit link woud be
broken because the prefix is stripped.

The reason is `URI.resolve()` is given an absolute path which strip the
path from the base URI:

  jshell> new URI("https://example.org/r").resolve("/admin/repos/edit");
                                      ^^
  $2 ==> https://example.org/admin/repos/edit
                           ^^^____oops

Which is consistent with python `os.path`:

  >>> os.path.join('https://example.org/r', '/admin/repos/edit');
  '/admin/repos/edit'

Remove the leading slash from the edit URI and update the test with the
proper expected value.

Bug: https://phabricator.wikimedia.org/T405481
Change-Id: I98e9d89cbc4850270f81b52665f2c8849f25c879
2 files changed
tree: c9b12547365b9f6e78ea328d6d3461288393a6ba
  1. .settings/
  2. Documentation/
  3. java/
  4. javatests/
  5. lib/
  6. modules/
  7. resources/
  8. tools/
  9. .bazelrc
  10. .bazelversion
  11. .gitignore
  12. .gitmodules
  13. .mailmap
  14. .zuul.yaml
  15. BUILD
  16. COPYING
  17. fake_pom_deploy.xml
  18. navbar.md
  19. README.md
  20. version.bzl
  21. WORKSPACE
README.md

Gitiles - A simple JGit repository browser

Gitiles is a simple repository browser for Git repositories, built on JGit. Its guiding principle is simplicity: it has no formal access controls, no write access, no fancy Javascript, etc.

Gitiles automatically renders *.md Markdown files into HTML for simplified documentation. Refer to the Markdown documentation for details.

Configuration

Gitiles is configurable in a git-style configuration file named gitiles.config. Refer to the configuration documentation for details.

Bugs

Use gerrit's issue tracker to file bugs.

Contributing to Gitiles

Please refer to the Developer Guide.