summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-07-31 15:53:11 -0400
committerJames Moger <james.moger@gitblit.com>2013-07-31 15:56:10 -0400
commite523d77e5f9d61a7cbf0b2242c8795a22fdf7b45 (patch)
tree5937c6e4ffec72726d132f25ae29cadca4130d2e /src/main
parentd80588d99511fac16495f8eaafa50e01a6b98995 (diff)
downloadgitblit-e523d77e5f9d61a7cbf0b2242c8795a22fdf7b45.tar.gz
gitblit-e523d77e5f9d61a7cbf0b2242c8795a22fdf7b45.zip
Manually redirect after branch deletion (issue 282)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/BranchesPanel.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
index 7aa185bd..85d00296 100644
--- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
@@ -15,11 +15,13 @@
*/
package com.gitblit.wicket.panels;
+import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.markup.html.link.ExternalLink;
@@ -29,6 +31,9 @@ import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.markup.repeater.data.DataView;
import org.apache.wicket.markup.repeater.data.ListDataProvider;
import org.apache.wicket.model.StringResourceModel;
+import org.apache.wicket.protocol.http.RequestUtils;
+import org.apache.wicket.request.target.basic.RedirectRequestTarget;
+import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import com.gitblit.Constants;
@@ -216,6 +221,12 @@ public class BranchesPanel extends BasePanel {
else {
error(MessageFormat.format("Failed to delete branch \"{0}\"", branch));
}
+
+ // redirect to the owning page
+ PageParameters params = WicketUtils.newRepositoryParameter(repositoryModel.name);
+ String relativeUrl = urlFor(getPage().getClass(), params).toString();
+ String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);
+ getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
}
};