libgit2

git_reflog_drop

Version:

Remove an entry from the reflog by its index

To ensure there's no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

Signature

int git_reflog_drop(git_reflog *reflog, size_t idx, int rewrite_previous_entry);

Parameters

In
reflog

a previously loaded reflog.

size_t
In
idx

the position of the entry to remove. Should be greater than or equal to 0 (zero) and less than git_reflog_entrycount().

int
In
rewrite_previous_entry

1 to rewrite the history; 0 otherwise.

Returns

int

0 on success, GIT_ENOTFOUND if the entry doesn't exist or an error code.

Versions