Skip to content

Commit 36237b0

Browse files
authored
fix(cli): handle empty files (#430)
Signed-off-by: Jose I. Paris <[email protected]>
1 parent 2fe4887 commit 36237b0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

internal/casclient/uploader.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ func (c *Client) Upload(ctx context.Context, r io.Reader, filename, digest strin
8888
Msg("uploading")
8989

9090
var totalUploaded int64
91-
var latestStatus *UpDownStatus
91+
latestStatus := &UpDownStatus{
92+
Filename: filename,
93+
Digest: h.String(),
94+
}
9295

9396
doUpload:
9497
for {
@@ -131,11 +134,7 @@ doUpload:
131134
}
132135
}
133136

134-
latestStatus = &UpDownStatus{
135-
Filename: filename,
136-
Digest: h.String(),
137-
ProcessedBytes: totalUploaded,
138-
}
137+
latestStatus.ProcessedBytes = totalUploaded
139138

140139
select {
141140
case c.ProgressStatus <- latestStatus:

0 commit comments

Comments
 (0)