libgit2

git_config_add_file_ondisk

Version:

Add an on-disk config file instance to an existing config

The on-disk file pointed at by path will be opened and parsed; it's expected to be a native Git config file following the default Git config syntax (see man git-config).

Note that the configuration object will free the file automatically.

Further queries on this config object will access each of the config file instances in order (instances with a higher priority will be accessed first).

Signature

int git_config_add_file_ondisk(git_config *cfg, const char *path, int priority);

Parameters

In
cfg

the configuration to add the file to

const char *
In
path

path to the configuration file (backend) to add

int
In
priority

the priority the backend should have

Returns

int

GIT_SUCCESS or an error code

Versions