Skip to content

Commit

Permalink
Merge pull request moby#3424 from benlongo/use-skip-output-instead-of…
Browse files Browse the repository at this point in the history
…-negative-indexes

Use SkipOutput instead of -1 for output indexes to clarify semantics.
  • Loading branch information
tonistiigi authored Dec 20, 2022
2 parents f5551cc + 97a45ef commit c0e38e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/llb/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
inputIndex = pb.Empty
}

outputIndex := pb.OutputIndex(-1)
outputIndex := pb.SkipOutput
if !m.noOutput && !m.readonly && m.cacheID == "" && !m.tmpfs {
outputIndex = pb.OutputIndex(outIndex)
outIndex++
Expand Down
2 changes: 1 addition & 1 deletion client/llb/fileop.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
pop.Inputs = state.inputs

for i, st := range state.actions {
output := pb.OutputIndex(-1)
output := pb.SkipOutput
if i+1 == len(state.actions) {
output = 0
}
Expand Down

0 comments on commit c0e38e1

Please sign in to comment.