getStatusFile
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 NotFound.
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 Ambiguous 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 statuses
and scan through looking for the path that you are interested in.
Signature
class Repository {
getStatusFile(path: string): Status;
}
Parameters
- pathrequired · string
A single file path.
Returns
- Status
The
Status
of this single file.- conflictedrequired · boolean
- currentrequired · boolean
- ignoredrequired · boolean
- indexDeletedrequired · boolean
- indexModifiedrequired · boolean
- indexNewrequired · boolean
- indexRenamedrequired · boolean
- indexTypechangerequired · boolean
- wtDeletedrequired · boolean
- wtModifiedrequired · boolean
- wtNewrequired · boolean
- wtRenamedrequired · boolean
- wtTypechangerequired · boolean
- conflictedrequired · boolean
Errors
- Error
Throws error if the status file does not exist.