diff options
| author | Russell Belfer <rb@github.com> | 2013-01-04 16:56:21 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-01-04 16:56:21 -0800 |
| commit | bebdbcd442fb9b050589e9d7ba311850b0807f71 (patch) | |
| tree | 565539b4137a864b9d12e2e4ea055f86496a2e8f /tests-clar/checkout/index.c | |
| parent | cfc7b835d6702049968cb0a6899d9741e6e0ebf4 (diff) | |
| download | libgit2-bebdbcd442fb9b050589e9d7ba311850b0807f71.tar.gz | |
Fix crlf issue with checkout tests
Move some checkout utility functions into a shared file and fix
some crlf filtering issues when verifying file contents.
Diffstat (limited to 'tests-clar/checkout/index.c')
| -rw-r--r-- | tests-clar/checkout/index.c | 33 |
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(); |
