libgit2

git_config_lock

Version:

Lock the backend with the highest priority

Locking disallows anybody else from writing to that backend. Any updates made after locking will not be visible to a reader until the file is unlocked.

You can apply the changes by calling git_transaction_commit() before freeing the transaction. Either of these actions will unlock the config.

Signature

int git_config_lock(git_transaction **tx, git_config *cfg);

Parameters

In
tx

the resulting transaction, use this to commit or undo the changes

In
cfg

the configuration in which to lock

Returns

int

0 or an error code

Versions