Set correct target url for symlinks

When attemting to resolv targetUrl for a symlink dirname was calculated
incorrectly.
After removing all trailing slashes the index of the last '/' was
calculated in an effort to get the dirname part from what was before
this last slash.
When attempting to remove the last slash and everything after it the
index was unnecesarily decremented by one which lead to a faulty
targetUrl and a faulty link to the symlink target in the UI.

   path = "foo/bar"
   lastSlashIndex = 3
   dirPath = "foo/bar".substring(0, 3-1) => "fo"

So if symlink "./foo/bar" had target "./foo/bar.md" the link to target
would be "./fo/bar.md".

Gitiles Bug: https://github.com/google/gitiles/issues/144

Change-Id: I14d6631b2ba7879ca66c091b90daf18e8763f314
2 files changed
tree: 3f6b20ecd64ef1baa76fea383b0563648f6b9283
  1. .bazelrc
  2. .bazelversion
  3. .gitignore
  4. .mailmap
  5. .settings/
  6. BUILD
  7. COPYING
  8. Documentation/
  9. README.md
  10. WORKSPACE
  11. fake_pom_deploy.xml
  12. java/
  13. javatests/
  14. lib/
  15. navbar.md
  16. resources/
  17. tools/
  18. version.bzl
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 the issue tracker at github to file bugs.

Contributing to Gitiles

Please refer to the Developer Guide.