That way, it's usable for learning everything about credentials for example.
Unified · Split
| @@ -17,31 +17,35 @@ use crate::{ · 16 unmodified lines | ||
| 17 | 17 | impl File<'static> { |
| 18 | 18 | /// Open all global configuration files which involves the following sources: |
| 19 | 19 | /// |
| 20 | − /// * [system][crate::Source::System] | |
| 21 | − /// * [git][crate::Source::Git] | |
| 22 | − /// * [user][crate::Source::User] | |
| 20 | + /// * [git-installation](source::Kind::GitInstallation) | |
| 21 | + /// * [system](source::Kind::System) | |
| 22 | + /// * [globals](source::Kind::Global) | |
| 23 | 23 | /// |
| 24 | 24 | /// which excludes repository local configuration, as well as override-configuration from environment variables. |
| 25 | 25 | /// |
| 26 | 26 | /// Note that the file might [be empty][File::is_void()] in case no configuration file was found. |
| 27 | 27 | pub fn from_globals() -> Result<File<'static>, init::from_paths::Error> { |
| 28 | − let metas = [source::Kind::System, source::Kind::Global] | |
| 29 | − .iter() | |
| 30 | − .flat_map(|kind| kind.sources()) | |
| 31 | − .filter_map(|source| { | |
| 32 | − let path = source | |
| 33 | − .storage_location(&mut gix_path::env::var) | |
| 34 | − .and_then(|p| p.is_file().then_some(p)) | |
| 35 | − .map(Cow::into_owned); | |
| 28 | + let metas = [ | |
| 29 | + source::Kind::GitInstallation, | |
| 30 | + source::Kind::System, | |
| 31 | + source::Kind::Global, | |
| 32 | + ] | |
| 33 | + .iter() | |
| 34 | + .flat_map(|kind| kind.sources()) | |
| 35 | + .filter_map(|source| { | |
| 36 | + let path = source | |
| 37 | + .storage_location(&mut gix_path::env::var) | |
| 38 | + .and_then(|p| p.is_file().then_some(p)) | |
| 39 | + .map(Cow::into_owned); | |
| 36 | 40 | |
| 37 | − Metadata { | |
| 38 | − path, | |
| 39 | − source: *source, | |
| 40 | − level: 0, | |
| 41 | − trust: gix_sec::Trust::Full, | |
| 42 | − } | |
| 43 | − .into() | |
| 44 | − }); | |
| 41 | + Metadata { | |
| 42 | + path, | |
| 43 | + source: *source, | |
| 44 | + level: 0, | |
| 45 | + trust: gix_sec::Trust::Full, | |
| 46 | + } | |
| 47 | + .into() | |
| 48 | + }); | |
| 45 | 49 | |
| 46 | 50 | let home = gix_path::env::home_dir(); |
| 47 | 51 | let options = init::Options { |