pub enum Source {
GitInstallation,
System,
Git,
Local,
}
Expand description
A list of known global sources for git attribute files in order of ascending precedence.
This means that values from the first variant will be returned first.
Variants§
GitInstallation
The attribute file that the installation itself ships with.
System
System-wide attributes file. This is typically defined as
$(prefix)/etc/gitattributes
(where prefix is the git-installation directory).
Git
This is <xdg-config-home>/git/attributes
and is git application configuration per user.
Note that there is no ~/.gitattributes
file.
Local
The configuration of the repository itself, located in $GIT_DIR/info/attributes
.
Implementations§
Source§impl Source
impl Source
Sourcepub fn storage_location(
self,
env_var: &mut dyn FnMut(&str) -> Option<OsString>,
) -> Option<Cow<'static, Path>>
pub fn storage_location( self, env_var: &mut dyn FnMut(&str) -> Option<OsString>, ) -> Option<Cow<'static, Path>>
Produce a storage location for the this source while potentially querying environment variables using env_var(<name>)
,
or None
if the storage location could not be obtained.
Note that local sources are returned as relative paths to be joined with the base in a separate step.