@@ -55,42 +55,39 @@ impl Cache {
55
55
let home_env = & home_env;
56
56
let xdg_config_home_env = & xdg_config_home_env;
57
57
let git_prefix = & git_prefix;
58
- let mut install_path = use_installation. then ( crate :: env:: git:: install_config_path) . flatten ( ) ;
59
- let metas = [ git_config:: source:: Kind :: System , git_config:: source:: Kind :: Global ]
60
- . iter ( )
61
- . flat_map ( |kind| kind. sources ( ) )
62
- . filter_map ( |source| match install_path. take ( ) {
63
- Some ( install_path) => (
64
- & git_config:: Source :: System ,
65
- git_path:: from_bstr ( install_path) . into_owned ( ) ,
66
- )
67
- . into ( ) ,
68
- None => {
69
- match source {
70
- git_config:: Source :: System if !use_system => return None ,
71
- git_config:: Source :: Git if !use_git => return None ,
72
- git_config:: Source :: User if !use_user => return None ,
73
- _ => { }
58
+ let metas = [
59
+ git_config:: source:: Kind :: GitInstallation ,
60
+ git_config:: source:: Kind :: System ,
61
+ git_config:: source:: Kind :: Global ,
62
+ ]
63
+ . iter ( )
64
+ . flat_map ( |kind| kind. sources ( ) )
65
+ . filter_map ( |source| {
66
+ match source {
67
+ git_config:: Source :: GitInstallation if !use_installation => return None ,
68
+ git_config:: Source :: System if !use_system => return None ,
69
+ git_config:: Source :: Git if !use_git => return None ,
70
+ git_config:: Source :: User if !use_user => return None ,
71
+ _ => { }
72
+ }
73
+ source
74
+ . storage_location ( & mut |name| {
75
+ match name {
76
+ git_ if git_. starts_with ( "GIT_" ) => Some ( git_prefix) ,
77
+ "XDG_CONFIG_HOME" => Some ( xdg_config_home_env) ,
78
+ "HOME" => Some ( home_env) ,
79
+ _ => None ,
74
80
}
75
- source
76
- . storage_location ( & mut |name| {
77
- match name {
78
- git_ if git_. starts_with ( "GIT_" ) => Some ( git_prefix) ,
79
- "XDG_CONFIG_HOME" => Some ( xdg_config_home_env) ,
80
- "HOME" => Some ( home_env) ,
81
- _ => None ,
82
- }
83
- . and_then ( |perm| std:: env:: var_os ( name) . and_then ( |val| perm. check_opt ( val) ) )
84
- } )
85
- . map ( |p| ( source, p. into_owned ( ) ) )
86
- }
87
- } )
88
- . map ( |( source, path) | git_config:: file:: Metadata {
89
- path : Some ( path) ,
90
- source : * source,
91
- level : 0 ,
92
- trust : git_sec:: Trust :: Full ,
93
- } ) ;
81
+ . and_then ( |perm| std:: env:: var_os ( name) . and_then ( |val| perm. check_opt ( val) ) )
82
+ } )
83
+ . map ( |p| ( source, p. into_owned ( ) ) )
84
+ } )
85
+ . map ( |( source, path) | git_config:: file:: Metadata {
86
+ path : Some ( path) ,
87
+ source : * source,
88
+ level : 0 ,
89
+ trust : git_sec:: Trust :: Full ,
90
+ } ) ;
94
91
95
92
let err_on_nonexisting_paths = false ;
96
93
let mut globals = git_config:: File :: from_paths_metadata_buf (
0 commit comments