mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-04 12:14:50 +00:00
40 lines
901 B
C
40 lines
901 B
C
#include "clar_libgit2.h"
|
|
#include "fileops.h"
|
|
|
|
static git_repository *g_repo;
|
|
|
|
void test_repo_shallow__initialize(void)
|
|
{
|
|
}
|
|
|
|
void test_repo_shallow__cleanup(void)
|
|
{
|
|
cl_git_sandbox_cleanup();
|
|
}
|
|
|
|
void test_repo_shallow__no_shallow_file(void)
|
|
{
|
|
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
}
|
|
|
|
void test_repo_shallow__empty_shallow_file(void)
|
|
{
|
|
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
cl_git_mkfile("testrepo.git/shallow", "");
|
|
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
}
|
|
|
|
void test_repo_shallow__shallow_repo(void)
|
|
{
|
|
g_repo = cl_git_sandbox_init("shallow.git");
|
|
cl_assert_equal_i(1, git_repository_is_shallow(g_repo));
|
|
}
|
|
|
|
void test_repo_shallow__clears_errors(void)
|
|
{
|
|
g_repo = cl_git_sandbox_init("testrepo.git");
|
|
cl_assert_equal_i(0, git_repository_is_shallow(g_repo));
|
|
cl_assert_equal_p(NULL, giterr_last());
|
|
}
|