Skip to content

Commit c0e38e1

Browse files
authored
Merge pull request moby#3424 from benlongo/use-skip-output-instead-of-negative-indexes
Use SkipOutput instead of -1 for output indexes to clarify semantics.
2 parents f5551cc + 97a45ef commit c0e38e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

client/llb/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
339339
inputIndex = pb.Empty
340340
}
341341

342-
outputIndex := pb.OutputIndex(-1)
342+
outputIndex := pb.SkipOutput
343343
if !m.noOutput && !m.readonly && m.cacheID == "" && !m.tmpfs {
344344
outputIndex = pb.OutputIndex(outIndex)
345345
outIndex++

client/llb/fileop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
702702
pop.Inputs = state.inputs
703703

704704
for i, st := range state.actions {
705-
output := pb.OutputIndex(-1)
705+
output := pb.SkipOutput
706706
if i+1 == len(state.actions) {
707707
output = 0
708708
}

0 commit comments

Comments
 (0)