libgit2/tests/reset/reset_helpers.c
Carlos Martín Nieto 659cf2029f Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.

In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
2015-03-03 14:40:50 +01:00

21 lines
515 B
C

#include "clar_libgit2.h"
#include "reset_helpers.h"
void reflog_check(git_repository *repo, const char *refname,
size_t exp_count, const char *exp_email, const char *exp_msg)
{
git_reflog *log;
const git_reflog_entry *entry;
exp_email = exp_email;
cl_git_pass(git_reflog_read(&log, repo, refname));
cl_assert_equal_i(exp_count, git_reflog_entrycount(log));
entry = git_reflog_entry_byindex(log, 0);
if (exp_msg)
cl_assert_equal_s(exp_msg, git_reflog_entry_message(entry));
git_reflog_free(log);
}