Skip to content

Commit db3538e

Browse files
committed
root_commit
1 parent 4043391 commit db3538e

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/bencher_fingerprint/src/windows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ impl crate::Fingerprint {
55
windows::System::Profile::SystemManufacturers::SmbiosInformation::SerialNumber()
66
.ok()
77
.as_ref()
8-
.and_then(|uuid| Uuid::parse_str(uuid).ok())
8+
.and_then(|hstring| Uuid::parse_str(&hstring.to_string()).ok())
99
.map(|uuid| uuid.as_u128())
1010
.map(Self)
1111
}

services/cli/src/bencher/sub/project/run/project.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use bencher_fingerprint::Fingerprint;
12
use gix::Repository;
23

34
use crate::bencher::sub::project::run::branch::find_repo;
@@ -10,6 +11,17 @@ pub fn local_project() {
1011
if let Some(repo_name) = repo_name {
1112
println!("{repo_name}");
1213
}
14+
15+
if let Some(repo) = repo {
16+
if let Some(root_commit) = find_default_branch_and_root_commit(&repo) {
17+
println!("Root commit hash: {root_commit}");
18+
}
19+
}
20+
21+
let fingerprint = Fingerprint::new();
22+
if let Some(fingerprint) = fingerprint {
23+
println!("{fingerprint}");
24+
}
1325
}
1426

1527
fn repo_name(repo: Option<&Repository>) -> Option<String> {
@@ -20,3 +32,13 @@ fn repo_name(repo: Option<&Repository>) -> Option<String> {
2032
let file_name = parent.file_name()?;
2133
file_name.to_str().map(ToOwned::to_owned)
2234
}
35+
36+
fn find_default_branch_and_root_commit(repo: &Repository) -> Option<String> {
37+
let head_id = repo.head_id().ok()?;
38+
39+
let mut _rev_walk = repo.rev_walk([head_id]);
40+
41+
// let root_commit = rev_walk.all().into_iter().last()?.id().to_string();
42+
43+
None
44+
}

0 commit comments

Comments
 (0)