libgit2

git_reference_create_oid_f

Version:

Create a new object id reference, overwriting an existing one with the same name, if it exists.

If the new reference isn't an object id one, any pointers to the old reference become invalid.

The reference will be created in the repository and written to the disk.

This reference is owned by the repository and shall not be free'd by the user.

Signature

int git_reference_create_oid_f(git_reference **ref_out, git_repository *repo, const char *name, const git_oid *id);

Parameters

In
ref_out

Pointer to the newly created reference

In
repo

Repository where that reference will live

const char *
In
name

The name of the reference

In
id

The object id pointed to by the reference.

Returns

int

0 on success; error code otherwise

Versions