1- use std:: path:: PathBuf ;
2- use std:: {
3- ffi:: OsString ,
4- path:: Path ,
5- process:: { Command , Stdio } ,
6- } ;
1+ use std:: ffi:: OsString ;
2+ use std:: path:: { Path , PathBuf } ;
3+ use std:: process:: { Command , Stdio } ;
74
85use bstr:: { BStr , BString , ByteSlice } ;
6+ use once_cell:: sync:: Lazy ;
97
108/// Other places to find Git in.
119#[ cfg( windows) ]
12- pub ( super ) static ALTERNATIVE_LOCATIONS : once_cell :: sync :: Lazy < Vec < OsString > > = once_cell :: sync :: Lazy :: new ( || {
10+ pub ( super ) static ALTERNATIVE_LOCATIONS : Lazy < Vec < OsString > > = Lazy :: new ( || {
1311 vec ! [
1412 "C:/Program Files/Git/mingw64/bin" . into( ) ,
1513 "C:/Program Files (x86)/Git/mingw32/bin" . into( ) ,
@@ -24,7 +22,7 @@ pub(super) static EXE_NAME: &str = "git.exe";
2422pub ( super ) static EXE_NAME : & str = "git" ;
2523
2624/// Invoke the git executable in PATH to obtain the origin configuration, which is cached and returned.
27- pub ( super ) static EXE_INFO : once_cell :: sync :: Lazy < Option < BString > > = once_cell :: sync :: Lazy :: new ( || {
25+ pub ( super ) static EXE_INFO : Lazy < Option < BString > > = Lazy :: new ( || {
2826 let git_cmd = |executable : PathBuf | {
2927 let mut cmd = Command :: new ( executable) ;
3028 cmd. args ( [ "config" , "-l" , "--show-origin" ] )
@@ -55,7 +53,7 @@ pub(super) static EXE_INFO: once_cell::sync::Lazy<Option<BString>> = once_cell::
5553/// if no `git` executable was found or there were other errors during execution.
5654pub ( super ) fn install_config_path ( ) -> Option < & ' static BStr > {
5755 let _span = gix_trace:: detail!( "gix_path::git::install_config_path()" ) ;
58- static PATH : once_cell :: sync :: Lazy < Option < BString > > = once_cell :: sync :: Lazy :: new ( || {
56+ static PATH : Lazy < Option < BString > > = Lazy :: new ( || {
5957 // Shortcut: in Msys shells this variable is set which allows to deduce the installation directory,
6058 // so we can save the `git` invocation.
6159 #[ cfg( windows) ]
0 commit comments