Skip to content

Commit df861f5

Browse files
committed
Adding methods to GHCreateRepositoryBuilder to allow setting the allowed merge methods for pull requests.
1 parent e25ae27 commit df861f5

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

src/main/java/org/kohsuke/github/GHCreateRepositoryBuilder.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class GHCreateRepositoryBuilder {
2121
}
2222

2323
public GHCreateRepositoryBuilder description(String description) {
24-
this.builder.with("description",description);
25-
return this;
24+
this.builder.with("description",description);
25+
return this;
2626
}
2727

2828
public GHCreateRepositoryBuilder homepage(URL homepage) {
@@ -74,6 +74,30 @@ public GHCreateRepositoryBuilder autoInit(boolean b) {
7474
return this;
7575
}
7676

77+
/**
78+
* Allow or disallow squash-merging pull requests.
79+
*/
80+
public GHCreateRepositoryBuilder allowSquashMerge(boolean b) {
81+
this.builder.with("allow_squash_merge",b);
82+
return this;
83+
}
84+
85+
/**
86+
* Allow or disallow merging pull requests with a merge commit.
87+
*/
88+
public GHCreateRepositoryBuilder allowMergeCommit(boolean b) {
89+
this.builder.with("allow_merge_commit",b);
90+
return this;
91+
}
92+
93+
/**
94+
* Allow or disallow rebase-merging pull requests.
95+
*/
96+
public GHCreateRepositoryBuilder allowRebaseMerge(boolean b) {
97+
this.builder.with("allow_rebase_merge",b);
98+
return this;
99+
}
100+
77101
/**
78102
* Creates a default .gitignore
79103
*

0 commit comments

Comments
 (0)