git_index_add_bypath

Add or update an index entry from a file on disk

The file path must be relative to the repository's working folder and must be readable.

This method will fail in bare index instances.

This forces the file to be added to the index, not looking at gitignore rules. Those rules can be evaluated through the git_status APIs (in status.h) before calling this.

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

extern (C) nothrow @nogc public
int
git_index_add_bypath

Parameters

index libgit2.types.git_index*

an existing index object

path const(char)*

filename to add

Return Value

Type: int

0 or an error code

Meta