fix: return error on non-ErrNotExist stat failures in Tar.Sync()
Previously, Sync() only checked for fs.ErrNotExist when classifying paths into copy vs delete. Non-NotExist stat errors (e.g. EACCES, EIO) caused the condition to be false, falling through to the else clause which incorrectly treated the path as copyable. This masked real errors and led to cryptic failures downstream. Restructure the condition into a three-way branch: - err == nil → copy - ErrNotExist → delete - other errors → return immediately with context This follows the pattern already used by entriesForPath() in the same file. Fixes #13654 Signed-off-by: Lidang Jiang <lidangjiang@gmail.com> Signed-off-by: Lidang-Jiang <lidangjiang@gmail.com>
L
Lidang-Jiang committed
6ce3fb57a86e4e857af3d3b75141974c1fba12d6
Parent: c1aefc7
Committed by Guillaume Lours <705411+glours@users.noreply.github.com>
on 4/3/2026, 10:29:07 AM