File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
src/tools/build_helper/src Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change 11use std:: path:: { Path , PathBuf } ;
22use std:: process:: { Command , Stdio } ;
33
4- use crate :: ci:: CiEnv ;
5-
64pub struct GitConfig < ' a > {
75 pub git_repository : & ' a str ,
86 pub nightly_branch : & ' a str ,
@@ -116,8 +114,8 @@ fn git_upstream_merge_base(
116114
117115/// Searches for the nearest merge commit in the repository that also exists upstream.
118116///
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.
121119pub fn get_closest_merge_commit (
122120 git_dir : Option < & Path > ,
123121 config : & GitConfig < ' _ > ,
@@ -129,15 +127,7 @@ pub fn get_closest_merge_commit(
129127 git. current_dir ( git_dir) ;
130128 }
131129
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 ( ) ) ;
141131
142132 git. args ( [
143133 "rev-list" ,
You can’t perform that action at this time.
0 commit comments