mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 05:50:21 +00:00
Just don't CRLF filter if there are no CRs
This commit is contained in:
parent
16798d08cf
commit
c094197bf9
@ -138,10 +138,12 @@ static int crlf_apply_to_odb(
|
||||
if (git_buf_text_gather_stats(&stats, from, false))
|
||||
return GIT_PASSTHROUGH;
|
||||
|
||||
/* If safecrlf is enabled, sanity-check the result. */
|
||||
if (stats.cr != stats.crlf ||
|
||||
(stats.crlf > 0 && stats.lf != stats.crlf)) {
|
||||
/* If there are no CR characters to filter out, then just pass */
|
||||
if (!stats.cr)
|
||||
return GIT_PASSTHROUGH;
|
||||
|
||||
/* If safecrlf is enabled, sanity-check the result. */
|
||||
if (stats.cr != stats.crlf || stats.lf != stats.crlf) {
|
||||
switch (ca->safe_crlf) {
|
||||
case GIT_SAFE_CRLF_FAIL:
|
||||
giterr_set(
|
||||
|
Loading…
Reference in New Issue
Block a user