@@ -45,6 +45,7 @@ impl GitSync {
45
45
& self ,
46
46
upstream_repo : String ,
47
47
upstream_commit : Option < String > ,
48
+ allow_noop : bool ,
48
49
) -> Result < PullResult , RustcPullError > {
49
50
// The upstream commit that we want to pull
50
51
let upstream_sha = if let Some ( sha) = upstream_commit {
@@ -215,17 +216,29 @@ After you fix the conflicts, `git add` the changes and run `git merge --continue
215
216
216
217
// This is the easy case, no merge was performed, so we bail
217
218
if current_sha == sha_pre_merge {
218
- eprintln ! (
219
- "No merge was performed, no changes to pull were found. Rolling back the preparation commit."
220
- ) ;
219
+ if allow_noop {
220
+ git_reset. disarm ( ) ;
221
+ eprintln ! (
222
+ "No merge was performed, no changes to pull were found. Keeping the intermediate state."
223
+ ) ;
224
+ } else {
225
+ eprintln ! (
226
+ "No merge was performed, no changes to pull were found. Rolling back the preparation commit."
227
+ ) ;
228
+ }
221
229
return Err ( RustcPullError :: NothingToPull ) ;
222
230
}
223
231
224
232
// But it can be more tricky - we can have only empty merge/rollup merge commits from
225
233
// rustc, so a merge was created, but the in-tree diff can still be empty.
226
234
// In that case we also bail.
227
235
if self . has_empty_diff ( & sha_pre_merge) {
228
- eprintln ! ( "Only empty changes were pulled. Rolling back the preparation commit." ) ;
236
+ if allow_noop {
237
+ git_reset. disarm ( ) ;
238
+ eprintln ! ( "Only empty changes were pulled. Keeping the intermediate state." ) ;
239
+ } else {
240
+ eprintln ! ( "Only empty changes were pulled. Rolling back the preparation commit." ) ;
241
+ }
229
242
return Err ( RustcPullError :: NothingToPull ) ;
230
243
}
231
244
0 commit comments