Files
libgit2/tests/index/splitindex.c
Etienne Samson 0bf7e0433d index: preserve extension parsing errors
Previously, we would clobber any extension-specific error message with
an "extension is truncated" message. This makes `read_extension`
correctly preserve those errors, takes responsibility for truncation
errors, and adds a new message with the actual extension signature for
unsupported mandatory extensions.
2019-01-24 12:12:04 +01:00

22 lines
464 B
C

#include "clar_libgit2.h"
#include "index.h"
static git_repository *g_repo;
void test_index_splitindex__initialize(void)
{
g_repo = cl_git_sandbox_init("splitindex");
}
void test_index_splitindex__cleanup(void)
{
cl_git_sandbox_cleanup();
}
void test_index_splitindex__fail_on_open(void)
{
git_index *idx;
cl_git_fail_with(-1, git_repository_index(&idx, g_repo));
cl_assert_equal_s(git_error_last()->message, "unsupported mandatory extension: 'link'");
}