Skip to main content

is_git_config_path

Function is_git_config_path 

Source
pub fn is_git_config_path(path: &str) -> bool
Expand description

Whether writing path can plant git configuration. A structural path fact, deliberately over-reporting:

  • a .git, .gitattributes or .gitmodules component, or a .gitconfig file name, compared ASCII-case-insensitively (APFS and NTFS fold case) after stripping trailing dots and spaces (Windows drops them);
  • global and system configuration: ~/.config/git/**, $XDG_CONFIG_HOME/git/**, /etc/gitconfig, and any .config/git component pair (relative paths may resolve under the home directory).

~, $HOME and ${HOME} prefixes are expanded and ./.. are normalized lexically before the global checks.