[TAR] Rename the second argument of TarWriter.init to force

This is for consistency with TarContainer.create.
This commit is contained in:
Timofey Solomko
2022-01-09 14:17:00 +03:00
parent 3508148fd7
commit 3388cb047b
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ public struct TarWriter {
private var longLinkNameCounter: UInt
private var localPaxHeaderCounter: UInt
public init(fileHandle: FileHandle, format: TarContainer.Format = .pax) {
public init(fileHandle: FileHandle, force format: TarContainer.Format = .pax) {
self.handle = fileHandle
self.format = format
self.longNameCounter = 0
+1 -1
View File
@@ -210,7 +210,7 @@ class TarCommand: Command {
let outputURL = URL(fileURLWithPath: self.input)
try "".write(to: outputURL, atomically: true, encoding: .utf8)
let handle = try FileHandle(forWritingTo: outputURL)
var writer = TarWriter(fileHandle: handle, format: self.useFormat ?? .pax)
var writer = TarWriter(fileHandle: handle, force: self.useFormat ?? .pax)
try TarEntry.generateEntries(&writer, inputPath, verbose)
try writer.finalize()
try handle.closeHandleCompat()
+1 -1
View File
@@ -31,7 +31,7 @@ class TarWriterTests: XCTestCase {
let tempFileUrl = tempDir.appendingPathComponent(UUID().uuidString, isDirectory: false)
try "".write(to: tempFileUrl, atomically: true, encoding: .utf8)
let handle = try FileHandle(forWritingTo: tempFileUrl)
var writer = TarWriter(fileHandle: handle, format: format)
var writer = TarWriter(fileHandle: handle, force: format)
for entry in entries {
try writer.append(entry)
}