Function git2::opts::set_search_path
source · pub unsafe fn set_search_path<P>(
level: ConfigLevel,
path: P
) -> Result<(), Error>where
P: IntoCString,
Expand description
Set the search path for a level of config data. The search path applied to shared attributes and ignore files, too.
level
must be one of ConfigLevel::System
, ConfigLevel::Global
,
ConfigLevel::XDG
, ConfigLevel::ProgramData
.
path
lists directories delimited by GIT_PATH_LIST_SEPARATOR
.
Use magic path $PATH
to include the old value of the path
(if you want to prepend or append, for instance).
This function is unsafe as it mutates the global state but cannot guarantee thread-safety. It needs to be externally synchronized with calls to access the global state.