diff options
author | René Scharfe <l.s.r@web.de> | 2015-03-05 20:06:02 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-05 15:27:48 -0800 |
commit | 4aff646d17e81084000100da586bef8f9d6a17a5 (patch) | |
tree | 622066ccb07b949730584e1833554b54aadeb87e /t/t5515 | |
parent | 282616c72d1d08a77ca4fe1186cb708c38408d87 (diff) | |
download | git-4aff646d17e81084000100da586bef8f9d6a17a5.tar.gz git-4aff646d17e81084000100da586bef8f9d6a17a5.tar.xz |
archive-zip: mark text files in archives
Set the text flag for ZIP archive entries that look like text files so
that unzip -a can be used to perform end-of-line conversions. Info-ZIP
zip does the same.
Detect binary files the same way as git diff and git grep do, namely by
checking for the attribute "diff" and its negation "-diff", and if none
is found by falling back to checking for the presence of NUL bytes in
the first few bytes of the file contents.
7-Zip, Windows' built-in ZIP functionality and Info-ZIP unzip without
the switch -a are not affected by the change and still extract text
files without doing any end-of-line conversions.
NB: The actual end-of-line style used in the archive entries doesn't
matter to unzip -a, as it converts any CR, CRLF and LF to the line end
characters appropriate for the platform it is running on.
Suggested-by: Ulrike Fischer <luatex@nililand.de>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515')
0 files changed, 0 insertions, 0 deletions