File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ fn get_git_hash_from_nix() -> Option<String> {
5757}
5858
5959fn get_git_hash_from_jj ( ) -> Option < String > {
60- if let Ok ( output ) = Command :: new ( "jj" )
60+ Command :: new ( "jj" )
6161 . args ( [
6262 "--ignore-working-copy" ,
6363 "--color=never" ,
@@ -67,17 +67,15 @@ fn get_git_hash_from_jj() -> Option<String> {
6767 "-T=commit_id ++ '-'" ,
6868 ] )
6969 . output ( )
70- {
71- if output. status . success ( ) {
70+ . ok ( )
71+ . filter ( |output| output. status . success ( ) )
72+ . map ( |output| {
7273 let mut parent_commits = String :: from_utf8 ( output. stdout ) . unwrap ( ) ;
7374 // If a development version of `jj` is compiled at a merge commit, this will
7475 // result in several commit ids separated by `-`s.
7576 parent_commits. truncate ( parent_commits. trim_end_matches ( '-' ) . len ( ) ) ;
76- return Some ( parent_commits) ;
77- }
78- }
79-
80- None
77+ parent_commits
78+ } )
8179}
8280
8381fn get_git_hash_from_git ( ) -> Option < String > {
You can’t perform that action at this time.
0 commit comments