Skip to content

Commit

Permalink
fixup! Josh preparations
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed May 2, 2024
1 parent 5616d3c commit f766802
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clippy_dev/src/sync.rs
Expand Up @@ -60,9 +60,10 @@ fn start_josh() -> impl Drop {
Josh(josh)
}

fn rustc_version() -> String {
fn rustc_hash(version: Option<String>) -> String {
let version = String::from_utf8(
process::Command::new("rustc")
.arg(format!("+{}", version.unwrap_or_default()))
.arg("--version")
.arg("--verbose")
.output()
Expand Down Expand Up @@ -112,7 +113,7 @@ pub fn rustc_pull() {
.run()
.expect("FAILED to commit rust-toolchain file, something went wrong");

let commit = rustc_version();
let commit = rustc_hash(Some(format!("nightly-{date}")));

// Make sure josh is running in this scope
{
Expand Down Expand Up @@ -178,7 +179,7 @@ pub fn rustc_push(rustc_path: String, github_user: String) {
// Prepare the branch. Pushing works much better if we use as base exactly
// the commit that we pulled from last time, so we use the `rustc --version`
// to find out which commit that would be.
let base = rustc_version();
let base = rustc_hash(None);

println!("Preparing {github_user}/rust (base: {base})...");
sh.change_dir(rustc_path);
Expand Down

0 comments on commit f766802

Please sign in to comment.