git_status_file

Get file status for a single file.

This tries to get status for the filename that you give. If no files match that name (in either the HEAD, index, or working directory), this returns git_error_code.GIT_ENOTFOUND.

If the name matches multiple files (for example, if the path names a directory or if running on a case- insensitive filesystem and yet the HEAD has two entries that both match the path), then this returns git_error_code.GIT_EAMBIGUOUS because it cannot give correct results.

This does not do any sort of rename detection. Renames require a set of targets and because of the path filtering, there is not enough information to check renames correctly. To check file status with rename detection, there is no choice but to do a full git_status_list_new and scan through looking for the path that you are interested in.

extern (C) nothrow @nogc
int
git_status_file

Parameters

status_flags uint*

Output combination of git_status_t values for file

repo libgit2_d.types.git_repository*

A repository object

path const(char)*

The exact path to retrieve status for relative to the repository working directory

Return Value

Type: int

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

Meta