libgit2

git_status_file

Version:

Get file status for a single file.

This is not quite the same as calling git_status_foreach_ext() with the pathspec set to the specified path.

Signature

int git_status_file(unsigned int *status_flags, git_repository *repo, const char *path);

Parameters

unsigned int *
In
status_flags

Output combination of git_status_t values for file

In
repo

A repository object

const char *
In
path

The file to retrieve status for relative to the repo workdir

Returns

int

0 on success, GIT_ENOTFOUND if the file is not found in the HEAD, index, and work tree, GIT_EAMBIGUOUS if path matches multiple files or if it refers to a folder, and -1 on other errors.

Versions