We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bc7223 commit ab859f1Copy full SHA for ab859f1
src/tools/build_helper/src/git.rs
@@ -95,7 +95,20 @@ pub fn updated_master_branch(
95
}
96
97
98
- Err("Cannot find any suitable upstream master branch".to_owned())
+ // In CI, prepare upstream master.
99
+ if CiEnv::is_ci() {
100
+ let mut git = Command::new("git");
101
+ if let Some(git_dir) = git_dir {
102
+ git.current_dir(git_dir);
103
+ }
104
+
105
+ git.args(["fetch", &upstream_remote, branch]);
106
+ let _ = output_result(&mut git)?;
107
108
+ Ok(format!("{upstream_remote}/{branch}"))
109
+ } else {
110
+ Err("Cannot find any suitable upstream master branch".to_owned())
111
112
113
114
/// Finds the nearest merge commit by comparing the local `HEAD` with the upstream branch's state.
0 commit comments