@@ -149,6 +149,8 @@ impl Config {
149149
150150 /// Remove multivar config variables in the config file with the highest level (usually the
151151 /// local one).
152+ ///
153+ /// The regular expression is applied case-sensitively on the value.
152154 pub fn remove_multivar ( & mut self , name : & str , regexp : & str ) -> Result < ( ) , Error > {
153155 let name = CString :: new ( name) ?;
154156 let regexp = CString :: new ( regexp) ?;
@@ -204,6 +206,8 @@ impl Config {
204206 ///
205207 /// This is the same as `get_bytes` except that it may return `Err` if
206208 /// the bytes are not valid utf-8.
209+ ///
210+ /// This method will return an error if this `Config` is not a snapshot.
207211 pub fn get_str ( & self , name : & str ) -> Result < & str , Error > {
208212 str:: from_utf8 ( self . get_bytes ( name) ?)
209213 . map_err ( |_| Error :: from_str ( "configuration value is not valid utf8" ) )
@@ -223,6 +227,10 @@ impl Config {
223227
224228 /// Get the value of a string config variable as an owned string.
225229 ///
230+ /// All config files will be looked into, in the order of their
231+ /// defined level. A higher level means a higher priority. The
232+ /// first occurrence of the variable will be returned here.
233+ ///
226234 /// An error will be returned if the config value is not valid utf-8.
227235 pub fn get_string ( & self , name : & str ) -> Result < String , Error > {
228236 let ret = Buf :: new ( ) ;
@@ -235,7 +243,15 @@ impl Config {
235243 . map_err ( |_| Error :: from_str ( "configuration value is not valid utf8" ) )
236244 }
237245
238- /// Get the value of a path config variable as an owned .
246+ /// Get the value of a path config variable as an owned `PathBuf`.
247+ ///
248+ /// A leading '~' will be expanded to the global search path (which
249+ /// defaults to the user's home directory but can be overridden via
250+ /// [`raw::git_libgit2_opts`].
251+ ///
252+ /// All config files will be looked into, in the order of their
253+ /// defined level. A higher level means a higher priority. The
254+ /// first occurrence of the variable will be returned here.
239255 pub fn get_path ( & self , name : & str ) -> Result < PathBuf , Error > {
240256 let ret = Buf :: new ( ) ;
241257 let name = CString :: new ( name) ?;
@@ -260,6 +276,10 @@ impl Config {
260276 /// If `glob` is `Some`, then the iterator will only iterate over all
261277 /// variables whose name matches the pattern.
262278 ///
279+ /// The regular expression is applied case-sensitively on the normalized form of
280+ /// the variable name: the section and variable parts are lower-cased. The
281+ /// subsection is left unchanged.
282+ ///
263283 /// # Example
264284 ///
265285 /// ```
@@ -293,6 +313,10 @@ impl Config {
293313 ///
294314 /// If `regexp` is `Some`, then the iterator will only iterate over all
295315 /// values which match the pattern.
316+ ///
317+ /// The regular expression is applied case-sensitively on the normalized form of
318+ /// the variable name: the section and variable parts are lower-cased. The
319+ /// subsection is left unchanged.
296320 pub fn multivar ( & self , name : & str , regexp : Option < & str > ) -> Result < ConfigEntries < ' _ > , Error > {
297321 let mut ret = ptr:: null_mut ( ) ;
298322 let name = CString :: new ( name) ?;
@@ -363,6 +387,8 @@ impl Config {
363387
364388 /// Set the value of an multivar config variable in the config file with the
365389 /// highest level (usually the local one).
390+ ///
391+ /// The regular expression is applied case-sensitively on the value.
366392 pub fn set_multivar ( & mut self , name : & str , regexp : & str , value : & str ) -> Result < ( ) , Error > {
367393 let name = CString :: new ( name) ?;
368394 let regexp = CString :: new ( regexp) ?;
@@ -398,6 +424,7 @@ impl Config {
398424 }
399425
400426 /// Parse a string as a bool.
427+ ///
401428 /// Interprets "true", "yes", "on", 1, or any non-zero number as true.
402429 /// Interprets "false", "no", "off", 0, or an empty string as false.
403430 pub fn parse_bool < S : IntoCString > ( s : S ) -> Result < bool , Error > {
0 commit comments