From f3ce6e80794ff3a234dbd8850c8501abda95cedb Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Wed, 11 Jul 2012 17:14:30 -0400 Subject: [PATCH] Fixes and adjustments to test suite --- src/com/gitblit/wicket/pages/RawPage.java | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/gitblit/wicket/pages/RawPage.java b/src/com/gitblit/wicket/pages/RawPage.java index c1ebea5..00cc5bf 100644 --- a/src/com/gitblit/wicket/pages/RawPage.java +++ b/src/com/gitblit/wicket/pages/RawPage.java @@ -37,23 +37,24 @@ super(params); if (!params.containsKey("r")) { - error("Repository not specified!"); + error(getString("gb.repositoryNotSpecified")); redirectToInterceptPage(new RepositoriesPage()); } final String repositoryName = WicketUtils.getRepositoryName(params); final String objectId = WicketUtils.getObject(params); final String blobPath = WicketUtils.getPath(params); - + String [] encodings = GitBlit.getEncodings(); + Repository r = GitBlit.self().getRepository(repositoryName); if (r == null) { - error("Can not load repository " + repositoryName); + error(getString("gb.canNotLoadRepository") + " " + repositoryName); redirectToInterceptPage(new RepositoriesPage()); return; } if (StringUtils.isEmpty(blobPath)) { // objectid referenced raw view - Label blobLabel = new Label("rawText", JGitUtils.getStringContent(r, objectId)); + Label blobLabel = new Label("rawText", JGitUtils.getStringContent(r, objectId, encodings)); WicketUtils.setCssClass(blobLabel, "plainprint"); add(blobLabel); } else { @@ -92,14 +93,14 @@ default: // plain text c = new Label("rawText", JGitUtils.getStringContent(r, commit.getTree(), - blobPath)); + blobPath, encodings)); WicketUtils.setCssClass(c, "plainprint"); } add(c); } else { // plain text Label blobLabel = new Label("rawText", JGitUtils.getStringContent(r, - commit.getTree(), blobPath)); + commit.getTree(), blobPath, encodings)); WicketUtils.setCssClass(blobLabel, "plainprint"); add(blobLabel); } -- Gitblit v1.9.1