libgit2

git_blob_create_from_workdir

Version:

Read a file from the working folder of a repository and write it to the object database.

Signature

int git_blob_create_from_workdir(git_oid *id, git_repository *repo, const char *relative_path);

Parameters

Out
id

return the id of the written blob

In
repo

repository where the blob will be written. this repository cannot be bare

const char *
In
relative_path

file from which the blob will be created, relative to the repository's working dir

Returns

int

0 or an error code

Versions