item.add(links);\r
} else if (isSubmodule) {\r
// submodule\r
- item.add(new Label("hashLabel", submodulePath + "@"));\r
Repository repository = GitBlit.self().getRepository(repositoryName);\r
String submoduleId = JGitUtils.getSubmoduleCommitId(repository, path, entry);\r
repository.close();\r
- LinkPanel commitHash = new LinkPanel("hashLink", null, submoduleId.substring(0, hashLen),\r
- TreePage.class, WicketUtils.newObjectParameter(\r
- submodulePath, submoduleId));\r
- WicketUtils.setCssClass(commitHash, "shortsha1");\r
- WicketUtils.setHtmlTooltip(commitHash, submoduleId); \r
- item.add(commitHash.setEnabled(hasSubmodule));\r
- \r
+ if (StringUtils.isEmpty(submoduleId)) {\r
+ // not a submodule at this commit, just a matching path\r
+ item.add(new Label("hashLabel").setVisible(false));\r
+ item.add(new Label("hashLink").setVisible(false));\r
+ } else {\r
+ // really a submodule\r
+ item.add(new Label("hashLabel", submodulePath + "@"));\r
+ LinkPanel commitHash = new LinkPanel("hashLink", null, submoduleId.substring(0, hashLen),\r
+ TreePage.class, WicketUtils.newObjectParameter(\r
+ submodulePath, submoduleId));\r
+ WicketUtils.setCssClass(commitHash, "shortsha1");\r
+ WicketUtils.setHtmlTooltip(commitHash, submoduleId); \r
+ item.add(commitHash.setEnabled(hasSubmodule));\r
+ }\r
Fragment links = new Fragment("historyLinks", "treeLinks", this);\r
links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,\r
WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r