Fix action icons in the log dialog being clipped on High-DPI displays
[TortoiseGit.git] / ext / libgit2-0003-Adding-a-CRLF-file-with-core.autocrlf-input-and-core.patch
blob4167683fc1e0fb9c43767889d4b9f905a86bef30
1 From 41bfaa4b73c16cc2cd833e8600be6d95d85729a7 Mon Sep 17 00:00:00 2001
2 From: Sven Strickroth <email@cs-ware.de>
3 Date: Fri, 23 Jan 2015 15:34:14 +0100
4 Subject: [PATCH] Adding a CRLF-file with core.autocrlf=input and
5 core.safecrlf=true does not fail as with vanilla git
7 Signed-off-by: Sven Strickroth <email@cs-ware.de>
8 ---
9 src/crlf.c | 13 +++++++++++++
10 tests/index/crlf.c | 6 ++++++
11 2 files changed, 19 insertions(+)
13 diff --git a/src/crlf.c b/src/crlf.c
14 index 27ba7eefd..dd5a7625c 100644
15 --- a/src/crlf.c
16 +++ b/src/crlf.c
17 @@ -156,6 +156,19 @@ static int crlf_apply_to_odb(
18 default:
19 break;
21 + } else if (stats.crlf && ca->auto_crlf == GIT_AUTO_CRLF_INPUT) {
22 + switch (ca->safe_crlf) {
23 + case GIT_SAFE_CRLF_FAIL:
24 + giterr_set(
25 + GITERR_FILTER, "CRLF would be replaced by LF in '%s'",
26 + git_filter_source_path(src));
27 + return -1;
28 + case GIT_SAFE_CRLF_WARN:
29 + /* TODO: issue warning when warning API is available */;
30 + break;
31 + default:
32 + break;
33 + }
37 diff --git a/tests/index/crlf.c b/tests/index/crlf.c
38 index 024f4b056..875001349 100644
39 --- a/tests/index/crlf.c
40 +++ b/tests/index/crlf.c
41 @@ -357,6 +357,9 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text_auto_attr(void)
43 cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
44 cl_assert_equal_oid(&oid, &entry->id);
46 + cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF);
47 + cl_git_fail(git_index_add_bypath(g_index, "newfile2.txt"));
50 void test_index_crlf__safecrlf_true_autocrlf_input_text__no_attr(void)
51 @@ -374,6 +377,9 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text__no_attr(void)
53 cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
54 cl_assert_equal_oid(&oid, &entry->id);
56 + cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF);
57 + cl_git_fail(git_index_add_bypath(g_index, "newfile2.txt"));
60 void test_index_crlf__safecrlf_true_no_attrs(void)
61 --
62 2.11.0.windows.3