@@ -171,7 +171,7 @@ extension Application {
171171
172172 let tarArgs : [ String ] = [ " -C " , tempDir. path ( percentEncoded: false ) , " -cf " , " - " , leafName]
173173
174- _ = isDirectory // kept for parity if future behavior diverges by source type
174+ _ = isDirectory // kept for parity if future behavior diverges by source type
175175
176176 try runTar ( args: tarArgs, stdinData: nil , outputToStdout: true )
177177 }
@@ -198,7 +198,8 @@ extension Application {
198198 }
199199
200200 let listed = try runTar ( args: [ " -tf " , archivePath. path ( percentEncoded: false ) ] , stdinData: nil , outputToStdout: false )
201- let entries = listed
201+ let entries =
202+ listed
202203 . split ( separator: " \n " , omittingEmptySubsequences: true )
203204 . map ( String . init)
204205
@@ -226,11 +227,13 @@ extension Application {
226227 outputToStdout: false
227228 )
228229
229- let topLevelNames = Set ( entries. compactMap { entry -> String ? in
230- let trimmed = entry. trimmingCharacters ( in: . whitespacesAndNewlines)
231- guard !trimmed. isEmpty else { return nil }
232- return String ( trimmed. split ( separator: " / " , maxSplits: 1 ) . first ?? " " )
233- } ) . sorted ( )
230+ let topLevelNames = Set (
231+ entries. compactMap { entry -> String ? in
232+ let trimmed = entry. trimmingCharacters ( in: . whitespacesAndNewlines)
233+ guard !trimmed. isEmpty else { return nil }
234+ return String ( trimmed. split ( separator: " / " , maxSplits: 1 ) . first ?? " " )
235+ }
236+ ) . sorted ( )
234237
235238 guard !topLevelNames. isEmpty else {
236239 throw ContainerizationError ( . invalidArgument, message: " tar stream has no copyable top-level entries " )
0 commit comments