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

Contributing to Gitiles

Please refer to the Developer Guide.