Expand description
Bindings to libgit2’s git_libgit2_opts function.
Functions§
- enable_
caching - Controls whether or not libgit2 will cache loaded objects. Enabled by default, but disabling this can improve performance and memory usage if loading a large number of objects that will not be referenced again. Disabling this will cause repository objects to clear their caches when next accessed.
- get_
extensions ⚠ - Returns the list of git extensions that are supported. This is the list of
built-in extensions supported by libgit2 and custom extensions that have
been added with
set_extensions
. Extensions that have been negated will not be returned. - get_
mwindow_ ⚠file_ limit - Get the maximum number of files that will be mapped at any time by the library.
- get_
mwindow_ ⚠mapped_ limit - Get the maximum memory that will be mapped in total by the library
- get_
mwindow_ ⚠size - Get the maximum mmap window size
- get_
search_ ⚠path - Get the search path for a given level of config data.
- get_
server_ ⚠connect_ timeout_ in_ milliseconds - Get server connect timeout in milliseconds
- get_
server_ ⚠timeout_ in_ milliseconds - Get server timeout in milliseconds
- reset_
search_ ⚠path - Reset the search path for a given level of config data to the default (generally based on environment variables).
- set_
cache_ ⚠object_ limit - Set the maximum data size for the given type of object to be considered
eligible for caching in memory. Setting to value to zero means that that
type of object will not be cached. Defaults to 0 for
ObjectType::Blob
(i.e. won’t cache blobs) and 4k forObjectType::Commit
,ObjectType::Tree
, andObjectType::Tag
. - set_
extensions ⚠ - Set that the given git extensions are supported by the caller. Extensions
supported by libgit2 may be negated by prefixing them with a
!
. For example: setting extensions to[ "!noop", "newext" ]
indicates that the caller does not want to support repositories with thenoop
extension but does want to support repositories with thenewext
extension. - set_
mwindow_ ⚠file_ limit - Set the maximum number of files that can be mapped at any time by the library. The default (0) is unlimited.
- set_
mwindow_ ⚠mapped_ limit - Set the maximum amount of memory that can be mapped at any time by the library.
- set_
mwindow_ ⚠size - Set the maximum mmap window size
- set_
search_ ⚠path - Set the search path for a level of config data. The search path applied to shared attributes and ignore files, too.
- set_
server_ ⚠connect_ timeout_ in_ milliseconds - Set server connect timeout in milliseconds
- set_
server_ ⚠timeout_ in_ milliseconds - Set server timeout in milliseconds
- set_
ssl_ ⚠cert_ dir - Set the SSL certificate-authority location to
path
.path
is the location of a directory holding several certificates, one per file. - set_
ssl_ ⚠cert_ file - Set the SSL certificate-authority location to
file
.file
is the location of a file containing several certificates concatenated together. - set_
verify_ ⚠owner_ validation - Set whether or not to verify ownership before performing a repository. Enabled by default, but disabling this can lead to code execution vulnerabilities.
- strict_
hash_ verification - Controls whether or not libgit2 will verify that objects loaded have the expected hash. Enabled by default, but disabling this can significantly improve performance, at the cost of relying on repository integrity without checking it.
- strict_
object_ creation - Controls whether or not libgit2 will verify when writing an object that all objects it references are valid. Enabled by default, but disabling this can significantly improve performance, at the cost of potentially allowing the creation of objects that reference invalid objects (due to programming error or repository corruption).