Skip to content

Commit

Permalink
[beta] Attempt to fix prerelease version calculation
Browse files Browse the repository at this point in the history
We got #47396 merged but it looks like rcs failed to deploy the beta because
when it tried to calculate the beta version its cwd was different. Let's try to
fix this bug and fix auto-deploy by explicitly setting the `current_dir` for git
commands.
  • Loading branch information
alexcrichton committed Jan 18, 2018
1 parent 334ef62 commit cbfb985
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,15 @@ impl Build {
.arg("ls-remote")
.arg("origin")
.arg("beta")
.current_dir(&self.src)
);
let beta = beta.trim().split_whitespace().next().unwrap();
let master = output(
Command::new("git")
.arg("ls-remote")
.arg("origin")
.arg("master")
.current_dir(&self.src)
);
let master = master.trim().split_whitespace().next().unwrap();

Expand All @@ -802,7 +804,8 @@ impl Build {
Command::new("git")
.arg("merge-base")
.arg(beta)
.arg(master),
.arg(master)
.current_dir(&self.src),
);
let base = base.trim();

Expand All @@ -813,7 +816,8 @@ impl Build {
.arg("rev-list")
.arg("--count")
.arg("--merges")
.arg(format!("{}...HEAD", base)),
.arg(format!("{}...HEAD", base))
.current_dir(&self.src),
);
let n = count.trim().parse().unwrap();
self.prerelease_version.set(Some(n));
Expand Down

0 comments on commit cbfb985

Please sign in to comment.