libgit2

git_odb_open

Version:

Create a new object database and automatically add the two default backends:

  • git_odb_backend_loose: read and write loose object files from disk, assuming objects_dir as the Objects folder
  • git_odb_backend_pack: read objects from packfiles, assuming objects_dir as the Objects folder which contains a 'pack/' folder with the corresponding data

Signature

int git_odb_open(git_odb **odb_out, const char *objects_dir);

Parameters

Out
odb_out

location to store the database pointer, if opened. Set to NULL if the open failed.

const char *
In
objects_dir

path of the backends' "objects" directory.

Returns

int

0 or an error code

Versions