James Moger
2013-05-24 51c76e7366c2e8851f1639fbdbf2b8deb219c7fc
src/main/java/com/gitblit/wicket/panels/RefsPanel.java
@@ -22,6 +22,7 @@
import java.util.Map;
import org.apache.wicket.Component;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
@@ -35,12 +36,15 @@
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.pages.CommitPage;
import com.gitblit.wicket.pages.LogPage;
import com.gitblit.wicket.pages.RepositoryPage;
import com.gitblit.wicket.pages.TagPage;
public class RefsPanel extends Panel {
   private static final long serialVersionUID = 1L;
   private static final String R_CHANGES = "refs/changes/";
   private static final String R_PULL= "refs/pull/";
   public RefsPanel(String id, final String repositoryName, RevCommit c,
         Map<ObjectId, List<RefModel>> refs) {
@@ -97,7 +101,7 @@
            String name = entry.displayName;
            String objectid = entry.getReferencedObjectId().getName();
            boolean breakLine = false;
            Class<? extends RepositoryPage> linkClass = CommitPage.class;
            Class<? extends WebPage> linkClass = CommitPage.class;
            String cssClass = "";
            if (name.startsWith(Constants.R_HEADS)) {
               // local branch
@@ -108,6 +112,18 @@
               // local head
               linkClass = LogPage.class;
               cssClass = "headRef";
            } else if (name.startsWith(R_CHANGES)) {
               // Gerrit change ref
               name = name.substring(R_CHANGES.length());
               cssClass = "otherRef";
            } else if (name.startsWith(R_PULL)) {
               // Pull Request ref
               name = "pull #" + name.substring(R_PULL.length());
               if (name.endsWith("/head")) {
                  // strip pull request head from name
                  name = name.substring(0, name.length() - "/head".length());
               }
               cssClass = "pullRef";
            } else if (name.startsWith(Constants.R_REMOTES)) {
               // remote branch
               linkClass = LogPage.class;