mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-04 13:49:13 +01:00
Add new default branch option with 'main' as default
This commit is contained in:
committed by
René Pfeuffer
parent
b48bf24834
commit
196ea227d2
@@ -41,6 +41,8 @@ public class GitConfigDto extends HalRepresentation {
|
||||
|
||||
private boolean nonFastForwardDisallowed;
|
||||
|
||||
private String defaultBranch;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("squid:S1185") // We want to have this method available in this package
|
||||
protected HalRepresentation add(Links links) {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository;
|
||||
|
||||
//~--- JDK imports ------------------------------------------------------------
|
||||
@@ -33,7 +33,6 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
import javax.xml.bind.annotation.XmlTransient;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@XmlRootElement(name = "config")
|
||||
@@ -49,6 +48,9 @@ public class GitConfig extends RepositoryConfig {
|
||||
@XmlElement(name = "disallow-non-fast-forward")
|
||||
private boolean nonFastForwardDisallowed;
|
||||
|
||||
@XmlElement(name = "default-branch")
|
||||
private String defaultBranch = "main";
|
||||
|
||||
public String getGcExpression() {
|
||||
return gcExpression;
|
||||
}
|
||||
@@ -65,6 +67,14 @@ public class GitConfig extends RepositoryConfig {
|
||||
this.nonFastForwardDisallowed = nonFastForwardDisallowed;
|
||||
}
|
||||
|
||||
public String getDefaultBranch() {
|
||||
return defaultBranch;
|
||||
}
|
||||
|
||||
public void setDefaultBranch(String defaultBranch) {
|
||||
this.defaultBranch = defaultBranch;
|
||||
}
|
||||
|
||||
@Override
|
||||
@XmlTransient // Only for permission checks, don't serialize to XML
|
||||
public String getId() {
|
||||
|
||||
Reference in New Issue
Block a user