diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-17 09:15:49 +0300 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-17 09:15:49 +0300 |
commit | a56db99234017eb7814258dfe8bcdec365417a3b (patch) | |
tree | ba49074368a7d9b6dff87e8a6540e8137b29d4b9 /tests/checkout/crlf.c | |
parent | 5f83758fa35a7942457d676e41240dbfbda598b5 (diff) | |
parent | 892abf93157ea576fc3f2ccac118045a6a47247c (diff) |
Merge pull request #3219 from libgit2/cmn/racy-diff
Zero out racily-clean entries' file_size
Diffstat (limited to 'tests/checkout/crlf.c')
-rw-r--r-- | tests/checkout/crlf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/checkout/crlf.c b/tests/checkout/crlf.c index 381b04013..61459b3a4 100644 --- a/tests/checkout/crlf.c +++ b/tests/checkout/crlf.c @@ -4,6 +4,7 @@ #include "git2/checkout.h" #include "repository.h" +#include "index.h" #include "posix.h" static git_repository *g_repo; @@ -40,9 +41,10 @@ void test_checkout_crlf__autocrlf_false_index_size_is_unfiltered_size(void) cl_repo_set_bool(g_repo, "core.autocrlf", false); - git_checkout_head(g_repo, &opts); - git_repository_index(&index, g_repo); + tick_index(index); + + git_checkout_head(g_repo, &opts); cl_assert((entry = git_index_get_bypath(index, "all-lf", 0)) != NULL); cl_assert(entry->file_size == strlen(ALL_LF_TEXT_RAW)); @@ -140,9 +142,10 @@ void test_checkout_crlf__autocrlf_true_index_size_is_filtered_size(void) cl_repo_set_bool(g_repo, "core.autocrlf", true); - git_checkout_head(g_repo, &opts); - git_repository_index(&index, g_repo); + tick_index(index); + + git_checkout_head(g_repo, &opts); cl_assert((entry = git_index_get_bypath(index, "all-lf", 0)) != NULL); |