@@ -80,20 +80,23 @@ pub(super) async fn parse_input(
80
80
Ok ( Some ( NoMergesInput { merge_commits } ) )
81
81
}
82
82
83
- const DEFAULT_MESSAGE : & str = "
83
+ fn get_default_message ( repository_name : & str , default_branch : & str ) -> String {
84
+ format ! (
85
+ "
84
86
There are merge commits (commits with multiple parents) in your changes. We have a \
85
87
[no merge policy](https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy) \
86
88
so these commits will need to be removed for this pull request to be merged.
87
89
88
90
You can start a rebase with the following commands:
89
91
```shell-session
90
92
$ # rebase
91
- $ git rebase -i master
92
- $ # delete any merge commits in the editor that appears
93
+ $ git pull --rebase https://github.com/{repository_name}.git {default_branch}
93
94
$ git push --force-with-lease
94
95
```
95
96
96
- " ;
97
+ "
98
+ )
99
+ }
97
100
98
101
pub ( super ) async fn handle_input (
99
102
ctx : & Context ,
@@ -135,7 +138,10 @@ pub(super) async fn handle_input(
135
138
let mut message = config
136
139
. message
137
140
. as_deref ( )
138
- . unwrap_or ( DEFAULT_MESSAGE )
141
+ . unwrap_or ( & get_default_message (
142
+ & event. repository . full_name ,
143
+ & event. repository . default_branch ,
144
+ ) )
139
145
. to_string ( ) ;
140
146
141
147
let since_last_posted = if first_time {
@@ -212,7 +218,7 @@ mod test {
212
218
213
219
#[ test]
214
220
fn message ( ) {
215
- let mut message = DEFAULT_MESSAGE . to_string ( ) ;
221
+ let mut message = get_default_message ( "foo/bar" , "baz" ) . to_string ( ) ;
216
222
217
223
writeln ! ( message, "The following commits are merge commits:" ) . unwrap ( ) ;
218
224
@@ -228,8 +234,7 @@ There are merge commits (commits with multiple parents) in your changes. We have
228
234
You can start a rebase with the following commands:
229
235
```shell-session
230
236
$ # rebase
231
- $ git rebase -i master
232
- $ # delete any merge commits in the editor that appears
237
+ $ git pull --rebase https://github.com/foo/bar.git baz
233
238
$ git push --force-with-lease
234
239
```
235
240
0 commit comments