mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 06:17:02 +00:00

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.
21 lines
515 B
C
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);
|
|
}
|