From 0e44acbb2fec928a1606dc60f427a148fff405c9 Mon Sep 17 00:00:00 2001
From: Mohamed Ragab <moragab@gmail.com>
Date: Wed, 02 May 2012 11:15:01 -0400
Subject: [PATCH] Added a script to facilitate setting the proxy host and port and no proxy hosts, and then it concatenates all the java system properties for setting the java proxy configurations and puts the resulting string in an environment variable JAVA_PROXY_CONFIG, modified the scirpts gitblit,  gitblit-ubuntu, and gitblit-centos to source the java-proxy-config.sh script and then include the resulting java proxy configuration in the java command

---
 src/com/gitblit/models/RepositoryModel.java |   50 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/src/com/gitblit/models/RepositoryModel.java b/src/com/gitblit/models/RepositoryModel.java
index 3863737..324f7d4 100644
--- a/src/com/gitblit/models/RepositoryModel.java
+++ b/src/com/gitblit/models/RepositoryModel.java
@@ -16,9 +16,14 @@
 package com.gitblit.models;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import com.gitblit.Constants.AccessRestrictionType;
+import com.gitblit.Constants.FederationStrategy;
+import com.gitblit.utils.ArrayUtils;
+import com.gitblit.utils.StringUtils;
 
 /**
  * RepositoryModel is a serializable model class that represents a Gitblit
@@ -27,7 +32,7 @@
  * @author James Moger
  * 
  */
-public class RepositoryModel implements Serializable {
+public class RepositoryModel implements Serializable, Comparable<RepositoryModel> {
 
 	private static final long serialVersionUID = 1L;
 
@@ -43,7 +48,23 @@
 	public AccessRestrictionType accessRestriction;
 	public boolean isFrozen;
 	public boolean showReadme;
-
+	public FederationStrategy federationStrategy;
+	public List<String> federationSets;
+	public boolean isFederated;
+	public boolean skipSizeCalculation;
+	public boolean skipSummaryMetrics;
+	public String frequency;
+	public boolean isBare;
+	public String origin;
+	public String HEAD;
+	public List<String> availableRefs;
+	public List<String> indexedBranches;
+	public String size;
+	public List<String> preReceiveScripts;
+	public List<String> postReceiveScripts;
+	public List<String> mailingLists;
+	private String displayName;
+	
 	public RepositoryModel() {
 		this("", "", "", new Date(0));
 	}
@@ -54,10 +75,33 @@
 		this.owner = owner;
 		this.lastChange = lastchange;
 		this.accessRestriction = AccessRestrictionType.NONE;
+		this.federationSets = new ArrayList<String>();
+		this.federationStrategy = FederationStrategy.FEDERATE_THIS;		
+	}
+	
+	public List<String> getLocalBranches() {
+		if (ArrayUtils.isEmpty(availableRefs)) {
+			return new ArrayList<String>();
+		}
+		List<String> localBranches = new ArrayList<String>();
+		for (String ref : availableRefs) {
+			if (ref.startsWith("refs/heads")) {
+				localBranches.add(ref);
+			}
+		}
+		return localBranches;
 	}
 
 	@Override
 	public String toString() {
-		return name;
+		if (displayName == null) {
+			displayName = StringUtils.stripDotGit(name);
+		}
+		return displayName;
+	}
+
+	@Override
+	public int compareTo(RepositoryModel o) {
+		return StringUtils.compareRepositoryNames(name, o.name);
 	}
 }
\ No newline at end of file

--
Gitblit v1.9.1