diff options
| author | Ben Straub <bstraub@github.com> | 2012-07-26 12:58:44 -0700 |
|---|---|---|
| committer | Ben Straub <bstraub@github.com> | 2012-07-26 12:58:44 -0700 |
| commit | ef9905c9902a9ffad71c8acddec74dc0d8e866de (patch) | |
| tree | 430227357c229d559571d65a9d2d008252b4ae64 /tests-clar/checkout | |
| parent | dc03369c07c6222c763cca8a80452608c8cce435 (diff) | |
| download | libgit2-ef9905c9902a9ffad71c8acddec74dc0d8e866de.tar.gz | |
checkout: introduce git_checkout_opts
Refactor checkout into several more-sensible
entry points, which consolidates common options
into a single structure that may be passed around.
Diffstat (limited to 'tests-clar/checkout')
| -rw-r--r-- | tests-clar/checkout/checkout.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests-clar/checkout/checkout.c b/tests-clar/checkout/checkout.c index 8c2b46e5..71f8f020 100644 --- a/tests-clar/checkout/checkout.c +++ b/tests-clar/checkout/checkout.c @@ -3,10 +3,6 @@ #include "git2/checkout.h" #include "repository.h" -#define DO_LOCAL_TEST 0 -#define DO_LIVE_NETWORK_TESTS 1 -#define LIVE_REPO_URL "http://github.com/libgit2/node-gitteh" - static git_repository *g_repo; @@ -42,12 +38,12 @@ void test_checkout_checkout__bare(void) { cl_git_sandbox_cleanup(); g_repo = cl_git_sandbox_init("testrepo.git"); - cl_git_fail(git_checkout_force(g_repo, NULL)); + cl_git_fail(git_checkout_index(g_repo, NULL)); } void test_checkout_checkout__default(void) { - cl_git_pass(git_checkout_force(g_repo, NULL)); + cl_git_pass(git_checkout_index(g_repo, NULL)); test_file_contents("./testrepo/README", "hey there\n"); test_file_contents("./testrepo/branch_file.txt", "hi\nbye!\n"); test_file_contents("./testrepo/new.txt", "my new file\n"); @@ -61,7 +57,7 @@ void test_checkout_checkout__crlf(void) "README text eol=cr\n" "new.txt text eol=lf\n"; cl_git_mkfile("./testrepo/.gitattributes", attributes); - cl_git_pass(git_checkout_force(g_repo, NULL)); + cl_git_pass(git_checkout_index(g_repo, NULL)); /* test_file_contents("./testrepo/README", "hey there\n"); */ /* test_file_contents("./testrepo/new.txt", "my new file\n"); */ /* test_file_contents("./testrepo/branch_file.txt", "hi\r\nbye!\r\n"); */ @@ -84,7 +80,7 @@ void test_checkout_checkout__symlinks(void) { /* First try with symlinks forced on */ enable_symlinks(true); - cl_git_pass(git_checkout_force(g_repo, NULL)); + cl_git_pass(git_checkout_index(g_repo, NULL)); #ifdef GIT_WIN32 test_file_contents("./testrepo/link_to_new.txt", "new.txt"); @@ -105,7 +101,7 @@ void test_checkout_checkout__symlinks(void) cl_git_sandbox_cleanup(); g_repo = cl_git_sandbox_init("testrepo"); enable_symlinks(false); - cl_git_pass(git_checkout_force(g_repo, NULL)); + cl_git_pass(git_checkout_index(g_repo, NULL)); test_file_contents("./testrepo/link_to_new.txt", "new.txt"); } |
