Skip to content

Commit b67cb01

Browse files
committed
[beta] Attempt to fix prerelease version calculation
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.
1 parent 597549e commit b67cb01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bootstrap/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -787,13 +787,15 @@ impl Build {
787787
.arg("ls-remote")
788788
.arg("origin")
789789
.arg("beta")
790+
.current_dir(&self.src)
790791
);
791792
let beta = beta.trim().split_whitespace().next().unwrap();
792793
let master = output(
793794
Command::new("git")
794795
.arg("ls-remote")
795796
.arg("origin")
796797
.arg("master")
798+
.current_dir(&self.src)
797799
);
798800
let master = master.trim().split_whitespace().next().unwrap();
799801

@@ -802,7 +804,8 @@ impl Build {
802804
Command::new("git")
803805
.arg("merge-base")
804806
.arg(beta)
805-
.arg(master),
807+
.arg(master)
808+
.current_dir(&self.src),
806809
);
807810
let base = base.trim();
808811

@@ -813,7 +816,8 @@ impl Build {
813816
.arg("rev-list")
814817
.arg("--count")
815818
.arg("--merges")
816-
.arg(format!("{}...HEAD", base)),
819+
.arg(format!("{}...HEAD", base))
820+
.current_dir(&self.src),
817821
);
818822
let n = count.trim().parse().unwrap();
819823
self.prerelease_version.set(Some(n));

0 commit comments

Comments
 (0)