From dfc4ece4083bbbb98f55291d05e7d2b1513464b7 Mon Sep 17 00:00:00 2001
From: Thomas Pummer <dev@nullpointer.at>
Date: Fri, 22 Feb 2013 11:10:11 -0500
Subject: [PATCH] the display-name in web.xml now shows the actual version of Gitblit

---
 src/com/gitblit/wicket/pages/TreePage.java |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/com/gitblit/wicket/pages/TreePage.java b/src/com/gitblit/wicket/pages/TreePage.java
index 345814f..bc27f0c 100644
--- a/src/com/gitblit/wicket/pages/TreePage.java
+++ b/src/com/gitblit/wicket/pages/TreePage.java
@@ -137,32 +137,38 @@
 								WicketUtils.newPathParameter(submodulePath, submoduleId,
 										"")).setEnabled(hasSubmodule));
 						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
-								WicketUtils.newPathParameter(submodulePath, submoduleId,
-										"")).setEnabled(hasSubmodule));
+								WicketUtils.newPathParameter(repositoryName, entry.commitId,
+										entry.path)));
 						links.add(new CompressedDownloadsPanel("compressedLinks", baseUrl,
 								submodulePath, submoduleId, "").setEnabled(hasSubmodule));
 						item.add(links);						
 					} else {
 						// blob link
+						String displayPath = entry.name;
+						String path = entry.path;
+						if (entry.isSymlink()) {
+							path = JGitUtils.getStringContent(getRepository(), getCommit().getTree(), path);
+							displayPath = entry.name + " -> " + path;
+						}
 						item.add(WicketUtils.getFileImage("pathIcon", entry.name));
 						item.add(new Label("pathSize", byteFormat.format(entry.size)));
-						item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class,
+						item.add(new LinkPanel("pathName", "list", displayPath, BlobPage.class,
 								WicketUtils.newPathParameter(repositoryName, entry.commitId,
-										entry.path)));
+										path)));
 
 						// links
 						Fragment links = new Fragment("pathLinks", "blobLinks", this);
 						links.add(new BookmarkablePageLink<Void>("view", BlobPage.class,
 								WicketUtils.newPathParameter(repositoryName, entry.commitId,
-										entry.path)));
+										path)));
 						links.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils
-								.newPathParameter(repositoryName, entry.commitId, entry.path)));
+								.newPathParameter(repositoryName, entry.commitId, path)));
 						links.add(new BookmarkablePageLink<Void>("blame", BlamePage.class,
 								WicketUtils.newPathParameter(repositoryName, entry.commitId,
-										entry.path)));
+										path)));
 						links.add(new BookmarkablePageLink<Void>("history", HistoryPage.class,
 								WicketUtils.newPathParameter(repositoryName, entry.commitId,
-										entry.path)));
+										path)));
 						item.add(links);
 					}
 				}

--
Gitblit v1.9.1