diff options
author | Jacques Germishuys <jacquesg@striata.com> | 2015-03-22 20:06:53 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-03-25 17:20:47 +0300 |
commit | 7c2b9e063b23f804ee056db177cd1b5e66832ccd (patch) | |
tree | c0c21e8ea5a7016bdcbd3b74b1073b4ff26c6038 /tests/checkout | |
parent | 8311db0cf8ae15b46edd14358a8238862e0bac4d (diff) |
Illustrate bad checkout on Windows
Diffstat (limited to 'tests/checkout')
-rw-r--r-- | tests/checkout/crlf.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/checkout/crlf.c b/tests/checkout/crlf.c index a7a579eaa..a9acdf406 100644 --- a/tests/checkout/crlf.c +++ b/tests/checkout/crlf.c @@ -347,3 +347,23 @@ void test_checkout_crlf__autocrlf_input_text_auto_attr(void) check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); } + +void test_checkout_crlf__can_write_empty_file(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_repo_set_bool(g_repo, "core.autocrlf", true); + + git_repository_set_head(g_repo, "refs/heads/empty-files"); + git_checkout_head(g_repo, &opts); + + check_file_contents("./crlf/test1.txt", ""); + + if (GIT_EOL_NATIVE == GIT_EOL_LF) + check_file_contents("./crlf/test2.txt", "test2.txt's content\n"); + else + check_file_contents("./crlf/test2.txt", "test2.txt's content\r\n"); + + check_file_contents("./crlf/test3.txt", ""); +} |