@@ -885,13 +885,16 @@ mod tests {
885
885
assert_eq ! ( git_version_from_bytes( b"git version 2.37.2\n " ) . unwrap( ) , ( 2 , 37 , 2 ) ) ;
886
886
}
887
887
888
- fn check_configure_clears_scope ( scope_env_var : & str , scope_option : & str ) {
889
- let temp = tempfile :: TempDir :: new ( ) . expect ( "can create temp dir" ) ;
888
+ fn check_configure_clears_scope ( scope_env_key : & str , scope_option : & str ) {
889
+ let scope_env_value = "gitconfig" ;
890
890
891
891
#[ cfg( windows) ]
892
- let names = [ "config" , "-" ] ;
892
+ let names = [ scope_env_value , "-" ] ;
893
893
#[ cfg( not( windows) ) ]
894
- let names = [ "config" , "-" , ":" ] ;
894
+ let names = [ scope_env_value, "-" , ":" ] ;
895
+
896
+ let temp = tempfile:: TempDir :: new ( ) . expect ( "can create temp dir" ) ;
897
+
895
898
for name in names {
896
899
File :: create_new ( temp. path ( ) . join ( name) )
897
900
. expect ( "can create file" )
@@ -900,7 +903,7 @@ mod tests {
900
903
}
901
904
902
905
let mut cmd = std:: process:: Command :: new ( "git" ) ;
903
- cmd. env ( scope_env_var , "config" ) ; // configure_command() should override it.
906
+ cmd. env ( scope_env_key , scope_env_value ) ; // configure_command() should override it.
904
907
let args = [ "config" , "-l" , "--show-origin" , scope_option] . map ( String :: from) ;
905
908
configure_command ( & mut cmd, & args, temp. path ( ) ) ;
906
909
0 commit comments