From 0c5cee25a1d9019de2d92427fda886a28076aa01 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 18 Sep 2013 11:31:02 -0400
Subject: [PATCH] Disable but improve the example commit message regexes
---
src/main/java/com/gitblit/client/EditTeamDialog.java | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/gitblit/client/EditTeamDialog.java b/src/main/java/com/gitblit/client/EditTeamDialog.java
index 4d7af26..7464055 100644
--- a/src/main/java/com/gitblit/client/EditTeamDialog.java
+++ b/src/main/java/com/gitblit/client/EditTeamDialog.java
@@ -44,9 +44,11 @@
import javax.swing.JTextField;
import javax.swing.KeyStroke;
+import com.gitblit.Constants;
import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.Constants.RegistrantType;
+import com.gitblit.Keys;
import com.gitblit.models.RegistrantAccessPermission;
import com.gitblit.models.RepositoryModel;
import com.gitblit.models.ServerSettings;
@@ -177,7 +179,7 @@
postReceivePalette = new JPalette<String>(true);
postReceiveInherited = new JLabel();
JPanel postReceivePanel = new JPanel(new BorderLayout(5, 5));
- postReceivePanel.add(postReceivePalette, BorderLayout.CENTER);
+ postReceivePanel.add(postReceivePalette, BorderLayout.CENTER);
postReceivePanel.add(postReceiveInherited, BorderLayout.WEST);
JTabbedPane panel = new JTabbedPane(JTabbedPane.TOP);
@@ -322,8 +324,22 @@
List<String> list = new ArrayList<String>();
// repositories
list.add(".*");
- // all repositories excluding personal repositories
- list.add("[^~].*");
+
+ String prefix;
+ if (settings.hasKey(Keys.git.userRepositoryPrefix)) {
+ prefix = settings.get(Keys.git.userRepositoryPrefix).currentValue;
+ if (StringUtils.isEmpty(prefix)) {
+ prefix = Constants.DEFAULT_USER_REPOSITORY_PREFIX;
+ }
+ } else {
+ prefix = Constants.DEFAULT_USER_REPOSITORY_PREFIX;
+ }
+
+ if (prefix.length() == 1) {
+ // all repositories excluding personal repositories
+ list.add("[^" + prefix + "].*");
+ }
+
String lastProject = null;
for (String repo : restricted) {
String projectPath = StringUtils.getFirstPathElement(repo);
--
Gitblit v1.9.1