mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 22:55:47 +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
634 B
C
21 lines
634 B
C
#include "clar_libgit2.h"
|
|
|
|
void test_refs_crashes__double_free(void)
|
|
{
|
|
git_repository *repo;
|
|
git_reference *ref, *ref2;
|
|
const char *REFNAME = "refs/heads/xxx";
|
|
|
|
cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));
|
|
cl_git_pass(git_reference_symbolic_create(&ref, repo, REFNAME, "refs/heads/master", 0, NULL));
|
|
cl_git_pass(git_reference_lookup(&ref2, repo, REFNAME));
|
|
cl_git_pass(git_reference_delete(ref));
|
|
git_reference_free(ref);
|
|
git_reference_free(ref2);
|
|
|
|
/* reference is gone from disk, so reloading it will fail */
|
|
cl_git_fail(git_reference_lookup(&ref2, repo, REFNAME));
|
|
|
|
git_repository_free(repo);
|
|
}
|