Compare commits

..

No commits in common. "cf4796909e088d823b836076c8e7053ce578a1d2" and "b7e33dc4b40f3d11e248703120fbf46651608907" have entirely different histories.

View File

@ -1,4 +1,4 @@
use std::{fs, path::PathBuf, process::Command};
use std::process::Command;
// https://stackoverflow.com/a/44407625
fn main() {
@ -7,17 +7,6 @@ fn main() {
.output()
.unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap();
match fs::read_to_string("../.git/HEAD") {
Ok(contents) => {
if let Some(branch_path) = contents.split(" ").skip(1).next() {
let path = PathBuf::from(".git").join(branch_path);
let path = path.to_str().unwrap_or(".git/HEAD");
println!("cargo:rerun-if-changed={}", path);
}
}
Err(err) => {
println!("cargo::warning=Failed to read .git/HEAD: {}", err);
}
}
println!("cargo:rustc-rerun-if-changed=.git/HEAD");
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}