head.c 481 Bytes
Newer Older
1 2
#include "clar_libgit2.h"
#include "refs.h"
3
#include "repo/repo_helpers.h"
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

static git_repository *g_repo;

void test_checkout_head__initialize(void)
{
	g_repo = cl_git_sandbox_init("testrepo");
}

void test_checkout_head__cleanup(void)
{
	cl_git_sandbox_cleanup();
}

void test_checkout_head__checking_out_an_orphaned_head_returns_GIT_EORPHANEDHEAD(void)
{
19
	make_head_orphaned(g_repo, NON_EXISTING_HEAD);
20

Ben Straub committed
21
	cl_assert_equal_i(GIT_EORPHANEDHEAD, git_checkout_head(g_repo, NULL));
22
}