Doc: Fix broken link
[TortoiseGit.git] / ext / libgit2-0006-Update-index_to_workdir-CrLf-conversion-to-match-Git.patch
blobbce0e46bf4d63460f08fa1b60253286fb222fddd
1 From 3a766cdf7533a9a258fafee1c145be2035a36441 Mon Sep 17 00:00:00 2001
2 From: Sven Strickroth <email@cs-ware.de>
3 Date: Sat, 28 Jan 2017 18:31:11 +0100
4 Subject: [PATCH] Update index_to_workdir CrLf conversion to match Git >= 2.9
5 logic
7 Signed-off-by: Sven Strickroth <email@cs-ware.de>
8 ---
9 src/crlf.c | 10 +++++++---
10 1 file changed, 7 insertions(+), 3 deletions(-)
12 diff --git a/src/crlf.c b/src/crlf.c
13 index b8ae5cda1..9c3db570a 100644
14 --- a/src/crlf.c
15 +++ b/src/crlf.c
16 @@ -70,6 +70,9 @@ static int crlf_input_action(struct crlf_attrs *ca)
17 if (ca->eol == GIT_EOL_LF)
18 return GIT_CRLF_INPUT;
20 + if (ca->crlf_action == GIT_CRLF_AUTO)
21 + return GIT_CRLF_AUTO;
23 if (ca->eol == GIT_EOL_CRLF)
24 return GIT_CRLF_CRLF;
26 @@ -199,6 +202,8 @@ static const char *line_ending(struct crlf_attrs *ca)
27 break;
29 case GIT_CRLF_AUTO:
30 + if (ca->eol == GIT_EOL_CRLF)
31 + return "\r\n";
32 case GIT_CRLF_TEXT:
33 break;
35 @@ -252,8 +257,7 @@ static int crlf_apply_to_workdir(
36 ca->crlf_action == GIT_CRLF_GUESS) {
38 /* If we have any existing CR or CRLF line endings, do nothing */
39 - if (ca->crlf_action == GIT_CRLF_GUESS &&
40 - stats.cr > 0 && stats.crlf > 0)
41 + if (stats.cr > 0 && stats.crlf > 0)
42 return GIT_PASSTHROUGH;
44 /* If we have bare CR characters, do nothing */
45 @@ -313,7 +317,7 @@ static int crlf_check(
46 ca.auto_crlf == GIT_AUTO_CRLF_FALSE)
47 return GIT_PASSTHROUGH;
49 - if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT &&
50 + if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT && ca.eol != GIT_EOL_CRLF &&
51 git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
52 return GIT_PASSTHROUGH;
54 --
55 2.11.0.windows.3