Fix missing reference name in JSON output

After I088ef448, the name of the ref was transmitted as an empty string
via JSON when the exact path of a reference was specified. Fix this
regression by not removing the path prefix for exactly matched refs and
add a test for it.

This fix only tries to establish the behavior prior to I088ef448. Even
previously, it was a bit peculiar: Branch names are truncated in the
JSON output when multiple refs are found for a given ref name. This
doesn't happen when text output is chosen or only a single ref is found.

Change-Id: I82ac61e4eb6812404566a393dd6e60c829d5cd97
2 files changed
tree: 65faa1c8005af45990b632d1e0da30e5eaa5d45f
  1. .bazelrc
  2. .gitignore
  3. .mailmap
  4. .settings/
  5. BUILD
  6. COPYING
  7. Documentation/
  8. README.md
  9. WORKSPACE
  10. fake_pom_deploy.xml
  11. java/com/google/gitiles/
  12. javatests/com/google/gitiles/
  13. lib/
  14. navbar.md
  15. resources/
  16. tools/
  17. 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.