Skip to content

Commit 27a7bf1

Browse files
author
Luke Daley
committed
Fall back to original command line if transform returns nil
1 parent 28ec135 commit 27a7bf1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/SWBCore/TaskGeneration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,7 @@ public protocol TaskTypeDescription: AnyObject, ConditionallyStartable, Sendable
889889

890890
/// The command line that should be used for the change-tracking signature, i.e.
891891
/// the command line with the output-agnostic arguments removed.
892+
/// A nil return indicates that the command line should be used as is.
892893
func commandLineForSignature(for task: any ExecutableTask) -> [ByteString]?
893894

894895
/// Whether instances of this task are unsafe to interrupt.

Sources/SWBTaskExecution/TaskActions/TaskAction.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ open class TaskAction: PlannedTaskAction, PolymorphicSerializable
6969
{
7070
let md5 = InsecureHashContext()
7171
md5.add(bytes: serializedRepresentationSignature!)
72-
for arg in task.type.commandLineForSignature(for: task) ?? [] {
72+
let commandLine = task.type.commandLineForSignature(for: task) ?? task.commandLine.map { $0.asByteString }
73+
for arg in commandLine {
7374
md5.add(bytes: arg)
7475
md5.add(number: 0)
7576
}

0 commit comments

Comments
 (0)