Skip to content

Commit ab859f1

Browse files
committed
test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 5bc7223 commit ab859f1

File tree

1 file changed

+14
-1
lines changed
  • src/tools/build_helper/src

1 file changed

+14
-1
lines changed

src/tools/build_helper/src/git.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,20 @@ pub fn updated_master_branch(
9595
}
9696
}
9797

98-
Err("Cannot find any suitable upstream master branch".to_owned())
98+
// 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+
}
99112
}
100113

101114
/// Finds the nearest merge commit by comparing the local `HEAD` with the upstream branch's state.

0 commit comments

Comments
 (0)