summaryrefslogtreecommitdiff
path: root/reflog-walk.h
diff options
context:
space:
mode:
authorDmitry Potapov <dpotapov@gmail.com>2008-01-16 01:59:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-01-16 17:10:34 (GMT)
commit28624193b2ce622144136d373e136455b6b13967 (patch)
tree1a37e1479070404d958ec63b91e17521de2030c0 /reflog-walk.h
parent4439751dcbc3ba2fccae70626654f7950a7b298c (diff)
downloadgit-28624193b2ce622144136d373e136455b6b13967.zip
git-28624193b2ce622144136d373e136455b6b13967.tar.gz
git-28624193b2ce622144136d373e136455b6b13967.tar.bz2
treat any file with NUL as binary
There are two heuristics in Git to detect whether a file is binary or text. One in xdiff-interface.c (which is taken from GNU diff) relies on existence of the NUL byte at the beginning. However, convert.c used a different heuristic, which relied on the percent of non-printable symbols (less than 1% for text files). Due to differences in detection whether a file is binary or not, it was possible that a file that diff treats as binary could be treated as text by CRLF conversion. This is very confusing for a user who sees that 'git diff' shows the file as binary expects it to be added as binary. This patch makes is_binary to consider any file that contains at least one NUL character as binary, to ensure that the heuristics used for CRLF conversion is tighter than what is used by diff. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reflog-walk.h')
0 files changed, 0 insertions, 0 deletions