libgit2

git_status_foreach

Version:

Gather file statuses and run a callback for each one.

The callback is passed the path of the file, the status (a combination of the git_status_t values above) and the payload data pointer passed into this function.

If the callback returns a non-zero value, this function will stop looping and return that value to caller.

Signature

int git_status_foreach(git_repository *repo, git_status_cb callback, void *payload);

Parameters

In
repo

A repository object

In
callback

The function to call on each file

void *
In
payload

Pointer to pass through to callback function

Returns

int

0 on success, non-zero callback return value, or error code

Versions