Blame tests/repo/shallow.c
|
Packit Service |
20376f |
#include "clar_libgit2.h"
|
|
Packit Service |
20376f |
#include "fileops.h"
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
static git_repository *g_repo;
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__initialize(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
}
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__cleanup(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
cl_git_sandbox_cleanup();
|
|
Packit Service |
20376f |
}
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__no_shallow_file(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
Packit Service |
20376f |
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
Packit Service |
20376f |
}
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__empty_shallow_file(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
Packit Service |
20376f |
cl_git_mkfile("testrepo.git/shallow", "");
|
|
Packit Service |
20376f |
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
Packit Service |
20376f |
}
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__shallow_repo(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
g_repo = cl_git_sandbox_init("shallow.git");
|
|
Packit Service |
20376f |
cl_assert_equal_i(1, git_repository_is_shallow(g_repo));
|
|
Packit Service |
20376f |
}
|
|
Packit Service |
20376f |
|
|
Packit Service |
20376f |
void test_repo_shallow__clears_errors(void)
|
|
Packit Service |
20376f |
{
|
|
Packit Service |
20376f |
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
Packit Service |
20376f |
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
Packit Service |
20376f |
cl_assert_equal_p(NULL, giterr_last());
|
|
Packit Service |
20376f |
}
|