archive: do not let on-disk mode leak to zip archives
commit6a616619679d78e116f775a37094c15e1f824775
authorJunio C Hamano <gitster@pobox.com>
Thu, 12 May 2022 21:31:09 +0000 (12 14:31 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 May 2022 21:32:25 +0000 (12 14:32 -0700)
treefc1423625c5697811dc8bcac13037e7c37d576ea
parente54793a95afeea1e10de1e5ad7eab914e7416250
archive: do not let on-disk mode leak to zip archives

When the "--add-file" option is used to add the contents from an
untracked file to the archive, the permission mode bits for these
files are sent to the archive-backend specific "write_entry()"
method as-is.  We normalize the mode bits for tracked files way
before we pass them to the write_entry() method; we should do the
same here.

This is not strictly needed for "tar" archive-backend, as it has its
own code to further clean them up, but "zip" archive-backend is not
so well prepared.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive.c