File tree 1 file changed +3
-13
lines changed
1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 1
1
use std:: path:: { Path , PathBuf } ;
2
2
use std:: process:: { Command , Stdio } ;
3
3
4
- use crate :: ci:: CiEnv ;
5
-
6
4
pub struct GitConfig < ' a > {
7
5
pub git_repository : & ' a str ,
8
6
pub nightly_branch : & ' a str ,
@@ -116,8 +114,8 @@ fn git_upstream_merge_base(
116
114
117
115
/// Searches for the nearest merge commit in the repository that also exists upstream.
118
116
///
119
- /// It looks for the most recent commit made by the merge bot by matching the author's email
120
- /// address with the merge bot's email.
117
+ /// If it fails to find the upstream remote, it then looks for the most recent commit made
118
+ /// by the merge bot by matching the author's email address with the merge bot's email.
121
119
pub fn get_closest_merge_commit (
122
120
git_dir : Option < & Path > ,
123
121
config : & GitConfig < ' _ > ,
@@ -129,15 +127,7 @@ pub fn get_closest_merge_commit(
129
127
git. current_dir ( git_dir) ;
130
128
}
131
129
132
- let merge_base = {
133
- if CiEnv :: is_ci ( ) {
134
- git_upstream_merge_base ( config, git_dir) . unwrap ( )
135
- } else {
136
- // For non-CI environments, ignore rust-lang/rust upstream as it usually gets
137
- // outdated very quickly.
138
- "HEAD" . to_string ( )
139
- }
140
- } ;
130
+ let merge_base = git_upstream_merge_base ( config, git_dir) . unwrap_or_else ( |_| "HEAD" . into ( ) ) ;
141
131
142
132
git. args ( [
143
133
"rev-list" ,
You can’t perform that action at this time.
0 commit comments