summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:08 (GMT)
commit9bc89b17e36db31a54bc3ff16e48b5cb6beb095b (patch)
tree160acf5d402bc4a638fbaa5ad7d16dc228e08f88 /diff.c
parent8fe806bcd5ac621e22982c73306e94d26e56cf79 (diff)
parent8462ff43e42ab67cecd16fdfb59451a53cc8a945 (diff)
downloadgit-9bc89b17e36db31a54bc3ff16e48b5cb6beb095b.zip
git-9bc89b17e36db31a54bc3ff16e48b5cb6beb095b.tar.gz
git-9bc89b17e36db31a54bc3ff16e48b5cb6beb095b.tar.bz2
Merge branch 'tb/crlf-conv-flags'
Code clean-up. * tb/crlf-conv-flags: convert_to_git(): safe_crlf/checksafe becomes int conv_flags
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/diff.c b/diff.c
index 0a9a0cd..e5c5cc4 100644
--- a/diff.c
+++ b/diff.c
@@ -3520,13 +3520,13 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
{
int size_only = flags & CHECK_SIZE_ONLY;
int err = 0;
+ int conv_flags = global_conv_flags_eol;
/*
* demote FAIL to WARN to allow inspecting the situation
* instead of refusing.
*/
- enum safe_crlf crlf_warn = (safe_crlf == SAFE_CRLF_FAIL
- ? SAFE_CRLF_WARN
- : safe_crlf);
+ if (conv_flags & CONV_EOL_RNDTRP_DIE)
+ conv_flags = CONV_EOL_RNDTRP_WARN;
if (!DIFF_FILE_VALID(s))
die("internal error: asking to populate invalid file.");
@@ -3603,7 +3603,7 @@ int diff_populate_filespec(struct diff_filespec *s, unsigned int flags)
/*
* Convert from working tree format to canonical git format
*/
- if (convert_to_git(&the_index, s->path, s->data, s->size, &buf, crlf_warn)) {
+ if (convert_to_git(&the_index, s->path, s->data, s->size, &buf, conv_flags)) {
size_t size = 0;
munmap(s->data, s->size);
s->should_munmap = 0;