summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages/DocsPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-07-22 17:47:53 -0400
committerJames Moger <james.moger@gitblit.com>2011-07-22 17:47:53 -0400
commita2709dd91e5d6b18f573016882ccc70799573ad3 (patch)
tree6b87a08d65c462d9f51b253e7deafb95c7167bbb /src/com/gitblit/wicket/pages/DocsPage.java
parentb1dba764c201f4708b82767b2d91edb6e189ce6f (diff)
downloadgitblit-a2709dd91e5d6b18f573016882ccc70799573ad3.tar.gz
gitblit-a2709dd91e5d6b18f573016882ccc70799573ad3.zip
Centralize default branch/HEAD resolution (issue 14)
If an object id was not specified Gitblit used HEAD to perform the operation. This breaks under some conditions like working with a repository that does not have any commits on master but does have commits on a vcs-import branch. The new approach is to centralize the resolution of unspecified object ids to a common method which resolves HEAD first but uses the most recently modified branch if HEAD points to nothing. This commit also includes a non-functional method for creating an empty branch. I couldn't figure out how to make JGit create an orphaned branch.
Diffstat (limited to 'src/com/gitblit/wicket/pages/DocsPage.java')
-rw-r--r--src/com/gitblit/wicket/pages/DocsPage.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/gitblit/wicket/pages/DocsPage.java b/src/com/gitblit/wicket/pages/DocsPage.java
index 40518b5c..9ddc98d3 100644
--- a/src/com/gitblit/wicket/pages/DocsPage.java
+++ b/src/com/gitblit/wicket/pages/DocsPage.java
@@ -56,8 +56,8 @@ public class DocsPage extends RepositoryPage {
PathModel entry = item.getModelObject();
item.add(WicketUtils.newImage("docIcon", "file_world_16x16.png"));
item.add(new Label("docSize", byteFormat.format(entry.size)));
- item.add(new LinkPanel("docName", "list", entry.name, BlobPage.class,
- newPathParameter(entry.path)));
+ item.add(new LinkPanel("docName", "list", entry.name, BlobPage.class, WicketUtils
+ .newPathParameter(repositoryName, entry.commitId, entry.path)));
// links
item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils