summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/manager
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2016-10-28 16:04:40 -0400
committerGitHub <noreply@github.com>2016-10-28 16:04:40 -0400
commitd64dd5de6cf6385d77dcd6014f1ce48369cf9ade (patch)
treed104751eb03d4cacce2560d4f6684836dd692379 /src/main/java/com/gitblit/manager
parentbac124176649617171a0d4be4b0a4edcfa073776 (diff)
parent355cbb8f10527032e9c9cedbef5b68f118418d68 (diff)
downloadgitblit-d64dd5de6cf6385d77dcd6014f1ce48369cf9ade.tar.gz
gitblit-d64dd5de6cf6385d77dcd6014f1ce48369cf9ade.zip
Merge pull request #1142 from fzs/merge-strategy
Merge strategy
Diffstat (limited to 'src/main/java/com/gitblit/manager')
-rw-r--r--src/main/java/com/gitblit/manager/RepositoryManager.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java
index ed26c775..2be65873 100644
--- a/src/main/java/com/gitblit/manager/RepositoryManager.java
+++ b/src/main/java/com/gitblit/manager/RepositoryManager.java
@@ -63,6 +63,7 @@ import com.gitblit.Constants.AccessRestrictionType;
import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.Constants.CommitMessageRenderer;
import com.gitblit.Constants.FederationStrategy;
+import com.gitblit.Constants.MergeType;
import com.gitblit.Constants.PermissionType;
import com.gitblit.Constants.RegistrantType;
import com.gitblit.GitBlitException;
@@ -899,6 +900,7 @@ public class RepositoryManager implements IRepositoryManager {
model.acceptNewTickets = getConfig(config, "acceptNewTickets", true);
model.requireApproval = getConfig(config, "requireApproval", settings.getBoolean(Keys.tickets.requireApproval, false));
model.mergeTo = getConfig(config, "mergeTo", null);
+ model.mergeType = MergeType.fromName(getConfig(config, "mergeType", settings.getString(Keys.tickets.mergeType, null)));
model.useIncrementalPushTags = getConfig(config, "useIncrementalPushTags", false);
model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null);
model.allowForks = getConfig(config, "allowForks", true);
@@ -1557,6 +1559,13 @@ public class RepositoryManager implements IRepositoryManager {
if (!StringUtils.isEmpty(repository.mergeTo)) {
config.setString(Constants.CONFIG_GITBLIT, null, "mergeTo", repository.mergeTo);
}
+ if (repository.mergeType == null || repository.mergeType == MergeType.fromName(settings.getString(Keys.tickets.mergeType, null))) {
+ // use default
+ config.unset(Constants.CONFIG_GITBLIT, null, "mergeType");
+ } else {
+ // override default
+ config.setString(Constants.CONFIG_GITBLIT, null, "mergeType", repository.mergeType.name());
+ }
config.setBoolean(Constants.CONFIG_GITBLIT, null, "useIncrementalPushTags", repository.useIncrementalPushTags);
if (StringUtils.isEmpty(repository.incrementalPushTagPrefix) ||
repository.incrementalPushTagPrefix.equals(settings.getString(Keys.git.defaultIncrementalPushTagPrefix, "r"))) {