File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
lib/bencher_fingerprint/src
services/cli/src/bencher/sub/project/run Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 1+ use bencher_fingerprint:: Fingerprint ;
12use gix:: Repository ;
23
34use 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
1527fn 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+ }
You can’t perform that action at this time.
0 commit comments