Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a5115842
Commit
a5115842
authored
Jan 28, 2017
by
Sven Strickroth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crlf: update checkout logic to reflect Git 2.9+ behaviour
Signed-off-by: Sven Strickroth <email@cs-ware.de>
parent
ad5a696e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
CHANGELOG.md
+2
-0
src/crlf.c
+7
-3
No files found.
CHANGELOG.md
View file @
a5115842
...
...
@@ -3,6 +3,8 @@ v0.27 + 1
### Changes or improvements
*
Update CrLf checkout code to vanilla Git >= 2.9 logic
### API additions
### API removals
...
...
src/crlf.c
View file @
a5115842
...
...
@@ -71,6 +71,9 @@ static int crlf_input_action(struct crlf_attrs *ca)
if
(
ca
->
eol
==
GIT_EOL_LF
)
return
GIT_CRLF_INPUT
;
if
(
ca
->
crlf_action
==
GIT_CRLF_AUTO
)
return
GIT_CRLF_AUTO
;
if
(
ca
->
eol
==
GIT_EOL_CRLF
)
return
GIT_CRLF_CRLF
;
...
...
@@ -200,6 +203,8 @@ static const char *line_ending(struct crlf_attrs *ca)
break
;
case
GIT_CRLF_AUTO
:
if
(
ca
->
eol
==
GIT_EOL_CRLF
)
return
"
\r\n
"
;
case
GIT_CRLF_TEXT
:
break
;
...
...
@@ -253,8 +258,7 @@ static int crlf_apply_to_workdir(
ca
->
crlf_action
==
GIT_CRLF_GUESS
)
{
/* If we have any existing CR or CRLF line endings, do nothing */
if
(
ca
->
crlf_action
==
GIT_CRLF_GUESS
&&
stats
.
cr
>
0
&&
stats
.
crlf
>
0
)
if
(
stats
.
cr
>
0
&&
stats
.
crlf
>
0
)
return
GIT_PASSTHROUGH
;
/* If we have bare CR characters, do nothing */
...
...
@@ -314,7 +318,7 @@ static int crlf_check(
ca
.
auto_crlf
==
GIT_AUTO_CRLF_FALSE
)
return
GIT_PASSTHROUGH
;
if
(
ca
.
auto_crlf
==
GIT_AUTO_CRLF_INPUT
&&
if
(
ca
.
auto_crlf
==
GIT_AUTO_CRLF_INPUT
&&
ca
.
eol
!=
GIT_EOL_CRLF
&&
git_filter_source_mode
(
src
)
==
GIT_FILTER_SMUDGE
)
return
GIT_PASSTHROUGH
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment