libgit2

git_config_get_path

Version:

Get the value of a path config variable.

A leading '~' will be expanded to the global search path (which defaults to the user's home directory but can be overridden via git_libgit2_opts().

All config files will be looked into, in the order of their defined level. A higher level means a higher priority. The first occurrence of the variable will be returned here.

Signature

int git_config_get_path(git_buf *out, const git_config *cfg, const char *name);

Parameters

In
out

the buffer in which to store the result

In
cfg

where to look for the variable

const char *
In
name

the variable's name

Returns

int

0 or an error code

Versions