summaryrefslogtreecommitdiff
path: root/tests-clar/checkout/index.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/checkout/index.c')
-rw-r--r--tests-clar/checkout/index.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/tests-clar/checkout/index.c b/tests-clar/checkout/index.c
index fe1f6874f..49e7093b8 100644
--- a/tests-clar/checkout/index.c
+++ b/tests-clar/checkout/index.c
@@ -1,25 +1,11 @@
#include "clar_libgit2.h"
+#include "checkout_helpers.h"
#include "git2/checkout.h"
#include "repository.h"
static git_repository *g_repo;
-static void reset_index_to_treeish(git_object *treeish)
-{
- git_object *tree;
- git_index *index;
-
- cl_git_pass(git_object_peel(&tree, treeish, GIT_OBJ_TREE));
-
- cl_git_pass(git_repository_index(&index, g_repo));
- cl_git_pass(git_index_read_tree(index, (git_tree *)tree));
- cl_git_pass(git_index_write(index));
-
- git_object_free(tree);
- git_index_free(index);
-}
-
void test_checkout_index__initialize(void)
{
git_tree *tree;
@@ -41,23 +27,6 @@ void test_checkout_index__cleanup(void)
cl_git_sandbox_cleanup();
}
-static void test_file_contents(const char *path, const char *expectedcontents)
-{
- int fd;
- char buffer[1024] = {0};
- size_t expectedlen, actuallen;
-
- fd = p_open(path, O_RDONLY);
- cl_assert(fd >= 0);
-
- expectedlen = strlen(expectedcontents);
- actuallen = p_read(fd, buffer, 1024);
- cl_git_pass(p_close(fd));
-
- cl_assert_equal_sz(actuallen, expectedlen);
- cl_assert_equal_s(buffer, expectedcontents);
-}
-
void test_checkout_index__cannot_checkout_a_bare_repository(void)
{
test_checkout_index__cleanup();