Skip to content

Commit 19898c7

Browse files
committed
build: Fix versioning number generation
We accidentally always generated '-dirty' even when the directory was clean.
1 parent 6889e2c commit 19898c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ fn main() {
4040
{
4141
let commits_since_release = commits_since_release();
4242
let changed_since_release = commits_since_release != "0";
43+
let changed_files = status.success();
4344

4445
let cargo_version = env!("CARGO_PKG_VERSION");
45-
let version = match (changed_since_release, status.success()) {
46-
(false, false) => cargo_version.to_owned(),
47-
(false, true) => format!("{}+dirty", cargo_version),
46+
let version = match (changed_since_release, changed_files) {
47+
(false, true) => cargo_version.to_owned(),
48+
(false, false) => format!("{}+dirty", cargo_version),
4849
(true, clean) => {
4950
let id_out = Command::new("git")
5051
.args(&["rev-parse", "--short", "HEAD"])

0 commit comments

Comments
 (0)