From c1a4cc7028954084019a7863085fa5d01aeafa9a Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 27 Dec 2011 17:31:03 -0500
Subject: [PATCH] fixed renaming a repository into a new subfolder failed (issue 33)
---
src/com/gitblit/ConfigUserService.java | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java
index a0a38e6..b899d92 100644
--- a/src/com/gitblit/ConfigUserService.java
+++ b/src/com/gitblit/ConfigUserService.java
@@ -62,6 +62,8 @@
private static final String REPOSITORY = "repository";
private static final String ROLE = "role";
+
+ private static final String MAILINGLIST = "mailingList";
private final File realmFile;
@@ -303,7 +305,7 @@
List<String> list = new ArrayList<String>(teams.keySet());
return list;
}
-
+
/**
* Returns the list of all users who are allowed to bypass the access
* restriction placed on the specified repository.
@@ -648,6 +650,14 @@
if (model.users != null) {
config.setStringList(TEAM, model.name, USER, new ArrayList<String>(model.users));
}
+
+ // null check on "final" mailing lists because JSON-sourced
+ // TeamModel
+ // can have a null users object
+ if (model.mailingLists != null) {
+ config.setStringList(TEAM, model.name, MAILINGLIST, new ArrayList<String>(
+ model.mailingLists));
+ }
}
config.save();
@@ -714,6 +724,7 @@
team.addRepositories(Arrays.asList(config.getStringList(TEAM, teamname,
REPOSITORY)));
team.addUsers(Arrays.asList(config.getStringList(TEAM, teamname, USER)));
+ team.addMailingLists(Arrays.asList(config.getStringList(TEAM, teamname, MAILINGLIST)));
teams.put(team.name.toLowerCase(), team);
--
Gitblit v1.9.1