mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-17 23:44:17 +08:00
Allow commit not found
This commit is contained in:
parent
cc593c6c58
commit
fec4236903
@ -301,6 +301,7 @@ pub fn get_git_head_rev(dir: &PathBuf) -> Result<(String, bool), String> {
|
||||
}
|
||||
}
|
||||
|
||||
/// get commit from "rev" which either a full commit hash or a tag name
|
||||
pub fn get_git_tag_rev(dir: &PathBuf, tag: &str) -> Result<String, String> {
|
||||
if tag.len() == 40 && tag.chars().all(|f| f.is_ascii_hexdigit()) {
|
||||
return Ok(tag.to_string());
|
||||
|
||||
@ -14,7 +14,7 @@ impl IdentifierConfig {
|
||||
let (commit, _) = crate::cook::fs::get_git_head_rev(
|
||||
&std::env::current_dir().expect("unable to get $PWD"),
|
||||
)
|
||||
.expect("Can't read this repository commit");
|
||||
.unwrap_or(("".into(), false));
|
||||
// better than importing heavy deps like chrono
|
||||
let time = String::from_utf8_lossy(
|
||||
&Command::new("date")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user