Do some more initialization in the initialization list
[TortoiseGit.git] / ext / libgit2-0003-Adding-a-CRLF-file-with-core.autocrlf-input-and-core.patch
blob7fa2ebbc463f40a9d274f16fa017381023c4cbdc
1 From 4a3f2fa9ed7260ed0d8fca1aa6130521d8cedb49 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 3/7] 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 1 file changed, 13 insertions(+)
12 diff --git a/src/crlf.c b/src/crlf.c
13 index c1f87485e..d88ad00f3 100644
14 --- a/src/crlf.c
15 +++ b/src/crlf.c
16 @@ -160,6 +160,19 @@ static int crlf_apply_to_odb(
17 default:
18 break;
20 + } else if (stats.crlf && ca->auto_crlf == GIT_AUTO_CRLF_INPUT) {
21 + switch (ca->safe_crlf) {
22 + case GIT_SAFE_CRLF_FAIL:
23 + giterr_set(
24 + GITERR_FILTER, "CRLF would be replaced by LF in '%s'",
25 + git_filter_source_path(src));
26 + return -1;
27 + case GIT_SAFE_CRLF_WARN:
28 + /* TODO: issue warning when warning API is available */;
29 + break;
30 + default:
31 + break;
32 + }
36 --
37 2.16.1.windows.4