From 27ae9095639bb228a1b7ff86a3ebe4264abf05be Mon Sep 17 00:00:00 2001
From: mschaefers <mschaefers@scoop-gmbh.de>
Date: Thu, 29 Nov 2012 12:33:09 -0500
Subject: [PATCH] feature: when using LdapUserService one can configure Gitblit to fetch all users from ldap that can possibly login. This allows to see newly generated LDAP users instantly in Gitblit. By now an LDAP user had to log in once to appear in GitBlit.

---
 src/com/gitblit/models/FederationModel.java |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/com/gitblit/models/FederationModel.java b/src/com/gitblit/models/FederationModel.java
index 3905190..1d211ce 100644
--- a/src/com/gitblit/models/FederationModel.java
+++ b/src/com/gitblit/models/FederationModel.java
@@ -45,6 +45,8 @@
 	public String frequency;
 
 	public String folder;
+	
+	public boolean bare;
 
     public boolean mirror;
 
@@ -71,6 +73,8 @@
 	 */
 	public FederationModel(String serverName) {
 		this.name = serverName;
+		bare = true;
+		mirror = true;
 		this.lastPull = new Date(0);
 		this.nextPull = new Date(0);
 	}
@@ -110,7 +114,7 @@
 	 * @param status
 	 */
 	public void updateStatus(RepositoryModel repository, FederationPullStatus status) {
-		if (!results.containsKey(repository)) {
+		if (!results.containsKey(repository.name)) {
 			results.put(repository.name, FederationPullStatus.PENDING);
 		}
 		if (status != null) {
@@ -194,22 +198,7 @@
 		@Override
 		public int compareTo(RepositoryStatus o) {
 			if (status.equals(o.status)) {
-				// sort root repositories first, alphabetically
-				// then sort grouped repositories, alphabetically
-				int s1 = name.indexOf('/');
-				int s2 = o.name.indexOf('/');
-				if (s1 == -1 && s2 == -1) {
-					// neither grouped
-					return name.compareTo(o.name);
-				} else if (s1 > -1 && s2 > -1) {
-					// both grouped
-					return name.compareTo(o.name);
-				} else if (s1 == -1) {
-					return -1;
-				} else if (s2 == -1) {
-					return 1;
-				}
-				return 0;
+				return StringUtils.compareRepositoryNames(name, o.name);
 			}
 			return status.compareTo(o.status);
 		}

--
Gitblit v1.9.1