summaryrefslogtreecommitdiff
path: root/src/buf_text.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-06-19 11:45:46 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-06-23 22:27:12 +0200
commit5a76ad35aaf709503dfc939464715666919180f8 (patch)
tree21a04047450efad085963790e081540cfb1e3614 /src/buf_text.h
parent1589aa0c4d48fb130d8a5db28c45cd3d173cde6d (diff)
downloadlibgit2-5a76ad35aaf709503dfc939464715666919180f8.tar.gz
crlf: pass-through mixed EOL buffers from LF->CRLFcmn/mixed-eol-passthrough
When checking out files, we're performing conversion into the user's native line endings, but we only want to do it for files which have consistent line endings. Refuse to perform the conversion for mixed-EOL files. The CRLF->LF filter is left as-is, as that conversion is considered to be normalization by git and should force a conversion of the line endings.
Diffstat (limited to 'src/buf_text.h')
-rw-r--r--src/buf_text.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buf_text.h b/src/buf_text.h
index 3ac9d1443..e753a0244 100644
--- a/src/buf_text.h
+++ b/src/buf_text.h
@@ -56,9 +56,10 @@ GIT_INLINE(int) git_buf_text_puts_escape_regex(git_buf *buf, const char *string)
extern void git_buf_text_unescape(git_buf *buf);
/**
- * Replace all \r\n with \n. Does not modify \r without trailing \n.
+ * Replace all \r\n with \n.
*
- * @return 0 on success, -1 on memory error
+ * @return 0 on success, -1 on memory error, GIT_PASSTHROUGH if the
+ * source buffer has mixed line endings.
*/
extern int git_buf_text_crlf_to_lf(git_buf *tgt, const git_buf *src);