pub struct Options {
    pub permissions: Permissions,
    /* private fields */
}
Expand description

The options used in ThreadSafeRepository::open_opts

Fields

permissions: Permissions

Define what is allowed while openeing a repository.

Implementations

Instantiation

Options configured to prevent accessing anything else than the repository configuration file, prohibiting accessing the environment or spreading beyond the git repository location.

Builder methods

Apply the given configuration values like init.defaultBranch=special or core.bool-implicit-true in memory to as early as the configuration is initialized to allow affecting the repository instantiation phase, both on disk or when opening. The configuration is marked with source API.

Set the amount of slots to use for the object database. It’s a value that doesn’t need changes on the client, typically, but should be controlled on the server.

Configure replacement objects, see the ReplacementObjects type for details.

Set the given permissions, which are typically derived by a Trust level.

Set the trust level of the .git directory we are about to open.

This can be set manually to force trust even though otherwise it might not be fully trusted, leading to limitations in how configuration files are interpreted.

If not called explicitly, it will be determined by looking at its ownership via git_sec::Trust::from_path_ownership().

Security Warning

Use with extreme care and only if it’s absolutely known that the repository is always controlled by the desired user. Using this capability only saves a permission check and only so if the open() method is used, as opposed to discovery.

If true, default false, and if the repository’s trust level is not Full (see with() for more), then the open operation will fail.

Use this to mimic gits way of handling untrusted repositories. Note that gitoxide solves this by not using configuration from untrusted sources and by generally being secured against doctored input files which at worst could cause out-of-memory at the time of writing.

Set the filter which determines if a configuration section can be used to read values from, hence it returns true if it is eligible.

The default filter selects sections whose trust level is full or whose source is not repository-local.

By default, in release mode configuration will be read without retaining non-essential information like comments or whitespace to optimize lookup performance.

Some application might want to toggle this to false in they want to display or edit configuration losslessly with all whitespace and comments included.

If set, default is false, invalid configuration values will cause an error even if these can safely be defaulted.

This is recommended for all applications that prefer correctness over usability. git itself defaults to strict configuration mode, flagging incorrect configuration immediately.

Open a repository at path with the options set so far.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Returns the “default value” for a type. Read more
Produce a default value for the given trust level.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.