From ca989c14ac877d79966552bb12692490534f6e99 Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Fri, 30 Jun 2023 13:03:39 +0200 Subject: [PATCH] Extend comment explaining the order of entries. --- .../System.Formats.Tar/src/System/Formats/Tar/TarFile.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs index dca2b3f6d3530..f1d6a059c5735 100644 --- a/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs +++ b/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs @@ -412,6 +412,7 @@ private static async Task CreateFromDirectoryInternalAsync(string sourceDirector private static IEnumerable<(string fullpath, string entryname)> GetFilesForCreation(string sourceDirectoryName, int basePathLength) { // The default order to write a tar archive is to recurse into subdirectories first. + // This order is expected by 'tar' to restore directory timestamps properly without the user explicitly specifying `--delay-directory-restore`. // FileSystemEnumerable RecurseSubdirectories will first write further entries before recursing, so we don't use it here. var fse = new FileSystemEnumerable<(string fullpath, string entryname, bool recurse)>(