tests: index::version: add test to read index version v4

While we have a simple test to determine whether we can write an index
of version 4, we never verified that we are able to read this kind of
index (and in fact, we were not able to do so). Add a new repository
which has an index of version 4. This repository is then read from a new
test.
This commit is contained in:
Patrick Steinhardt 2017-05-12 10:04:42 +02:00
parent fea0c81e95
commit 82368b1bad
13 changed files with 23 additions and 0 deletions

View File

@ -9,6 +9,29 @@ void test_index_version__cleanup(void)
g_repo = NULL;
}
void test_index_version__can_read_v4(void)
{
const char *paths[] = {
"file.tx", "file.txt", "file.txz", "foo", "zzz",
};
git_index *index;
size_t i;
g_repo = cl_git_sandbox_init("indexv4");
cl_git_pass(git_repository_index(&index, g_repo));
cl_assert_equal_sz(git_index_entrycount(index), 5);
for (i = 0; i < ARRAY_SIZE(paths); i++) {
const git_index_entry *entry =
git_index_get_bypath(index, paths[i], GIT_INDEX_STAGE_NORMAL);
cl_assert(entry != NULL);
}
git_index_free(index);
}
void test_index_version__can_write_v4(void)
{
git_index *index;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

View File

View File

View File

View File