- output(build.config.git().arg("merge-base").arg(&format!("{remote}/master")).arg("HEAD"));
- Some(
- output(build.config.git().arg("diff-index").arg("--name-only").arg(merge_base.trim()))
- .lines()
- .map(|s| s.trim().to_owned())
- .filter(|f| Path::new(f).extension().map_or(false, |ext| ext == "rs"))
- .collect(),
- )
-}
-
-/// Finds the remote for rust-lang/rust.
-/// For example for these remotes it will return `upstream`.
-/// ```text
-/// origin https://github.com/Nilstrieb/rust.git (fetch)
-/// origin https://github.com/Nilstrieb/rust.git (push)
-/// upstream https://github.com/rust-lang/rust (fetch)
-/// upstream https://github.com/rust-lang/rust (push)
-/// ```
-fn get_rust_lang_rust_remote() -> Result<String, String> {
- let mut git = Command::new("git");
- git.args(["config", "--local", "--get-regex", "remote\\..*\\.url"]);
-
- let output = git.output().map_err(|err| format!("{err:?}"))?;
- if !output.status.success() {
- return Err("failed to execute git config command".to_owned());
- }
-
- let stdout = String::from_utf8(output.stdout).map_err(|err| format!("{err:?}"))?;
-
- let rust_lang_remote = stdout
+ output_result(build.config.git().arg("merge-base").arg(&updated_master).arg("HEAD"))?;
+ Ok(Some(
+ output_result(
+ build.config.git().arg("diff-index").arg("--name-only").arg(merge_base.trim()),
+ )?