libgit2

git_odb_object_dup

Version:

Create a copy of an odb_object

The returned copy must be manually freed with git_odb_object_free. Note that because of an implementation detail, the returned copy will be the same pointer as source: the object is internally refcounted, so the copy still needs to be freed twice.

Signature

int git_odb_object_dup(git_odb_object **dest, git_odb_object *source);

Parameters

In
dest

pointer where to store the copy

In
source

object to copy

Returns

int

0 or an error code

Versions