diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-08 15:39:36 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-08 15:39:36 -0500 |
commit | f1b8822f715ea00da6b7d39a8ea63864aeda2d39 (patch) | |
tree | 7346119f7339db023df9e4457cc840e645ee4303 /src/main/java/com/gitblit/manager/RepositoryManager.java | |
parent | ea07809018ab5266e5568a63144a9998a3c95af8 (diff) | |
download | gitblit-f1b8822f715ea00da6b7d39a8ea63864aeda2d39.tar.gz gitblit-f1b8822f715ea00da6b7d39a8ea63864aeda2d39.zip |
Allow configuring the default integration branch for a repository
Diffstat (limited to 'src/main/java/com/gitblit/manager/RepositoryManager.java')
-rw-r--r-- | src/main/java/com/gitblit/manager/RepositoryManager.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/RepositoryManager.java b/src/main/java/com/gitblit/manager/RepositoryManager.java index 1e917984..839671c2 100644 --- a/src/main/java/com/gitblit/manager/RepositoryManager.java +++ b/src/main/java/com/gitblit/manager/RepositoryManager.java @@ -804,6 +804,7 @@ public class RepositoryManager implements IRepositoryManager { model.acceptNewPatchsets = getConfig(config, "acceptNewPatchsets", true); model.acceptNewTickets = getConfig(config, "acceptNewTickets", true); model.requireApproval = getConfig(config, "requireApproval", settings.getBoolean(Keys.tickets.requireApproval, false)); + model.mergeTo = getConfig(config, "mergeTo", null); model.useIncrementalPushTags = getConfig(config, "useIncrementalPushTags", false); model.incrementalPushTagPrefix = getConfig(config, "incrementalPushTagPrefix", null); model.allowForks = getConfig(config, "allowForks", true); @@ -854,6 +855,9 @@ public class RepositoryManager implements IRepositoryManager { } } model.HEAD = JGitUtils.getHEADRef(r); + if (StringUtils.isEmpty(model.mergeTo)) { + model.mergeTo = model.HEAD; + } model.availableRefs = JGitUtils.getAvailableHeadTargets(r); model.sparkleshareId = JGitUtils.getSparkleshareId(r); model.hasCommits = JGitUtils.hasCommits(r); @@ -1418,6 +1422,9 @@ public class RepositoryManager implements IRepositoryManager { // override default config.setBoolean(Constants.CONFIG_GITBLIT, null, "requireApproval", repository.requireApproval); } + if (!StringUtils.isEmpty(repository.mergeTo)) { + config.setString(Constants.CONFIG_GITBLIT, null, "mergeTo", repository.mergeTo); + } config.setBoolean(Constants.CONFIG_GITBLIT, null, "useIncrementalPushTags", repository.useIncrementalPushTags); if (StringUtils.isEmpty(repository.incrementalPushTagPrefix) || repository.incrementalPushTagPrefix.equals(settings.getString(Keys.git.defaultIncrementalPushTagPrefix, "r"))) { |