File tree Expand file tree Collapse file tree
Sources/NativeBuilder/ContainerBuildIR/Graph
Tests/NativeBuilderTests/ContainerBuildIRTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ public final class GraphBuilder {
219219 destination: destination,
220220 fileMetadata: FileMetadata (
221221 ownership: chown,
222- permissions: chmod
222+ permissions: chmod ?? . preserve
223223 )
224224 )
225225
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ struct DigestAndPlatformTests {
263263
264264 @Test func digestErrorMessages( ) throws {
265265 do {
266- try Digest ( algorithm: . sha256, bytes: Data ( count: 16 ) )
266+ _ = try Digest ( algorithm: . sha256, bytes: Data ( count: 16 ) )
267267 Issue . record ( " Should have thrown an error " )
268268 } catch let error as DigestError {
269269 switch error {
@@ -278,7 +278,7 @@ struct DigestAndPlatformTests {
278278 }
279279
280280 do {
281- try Digest ( parsing: " invalid:format " )
281+ _ = try Digest ( parsing: " invalid:format " )
282282 Issue . record ( " Should have thrown an error " )
283283 } catch let error as DigestError {
284284 switch error {
@@ -291,7 +291,7 @@ struct DigestAndPlatformTests {
291291 }
292292
293293 do {
294- try Digest ( parsing: " sha256:invalid-hex " )
294+ _ = try Digest ( parsing: " sha256:invalid-hex " )
295295 Issue . record ( " Should have thrown an error " )
296296 } catch let error as DigestError {
297297 switch error {
Original file line number Diff line number Diff line change @@ -267,8 +267,10 @@ struct SerializationTests {
267267
268268 // Check for COPY operation with metadata
269269 let copyOps = stage. nodes. compactMap { $0. operation as? FilesystemOperation }
270- let copyWithMetadata = copyOps. first { $0. fileMetadata != nil }
271- #expect( copyWithMetadata != nil , " COPY operation with metadata should be preserved " )
270+ let copyWithMetadata = copyOps. first {
271+ $0. fileMetadata. permissions != nil
272+ }
273+ #expect( copyWithMetadata != nil , " COPY operation should preserve file permissions by default " )
272274
273275 // Check for metadata operations
274276 let metaOps = stage. nodes. compactMap { $0. operation as? MetadataOperation }
You can’t perform that action at this time.
0 commit comments