Skip to content

Commit 74e9c33

Browse files
committed
Fix edge case in detecting things we don't expect to push
1 parent 137b0bf commit 74e9c33

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/bashbrew/cmd-put-shared.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ func cmdPutShared(c *cli.Context) error {
144144
if !force {
145145
remoteDigests := fetchRegistryManiestListDigests(image)
146146
sort.Strings(remoteDigests)
147+
if len(expectedRemoteDigests) == 0 && remoteDigests == nil {
148+
// https://github.com/golang/go/issues/12918 ...
149+
remoteDigests = []string{}
150+
// ("fetchRegistryManiestListDigests" returns a nil slice for things like 404, which if we expect to push 0 items is exactly what we want/expect)
151+
}
147152
if reflect.DeepEqual(remoteDigests, expectedRemoteDigests) {
148153
fmt.Fprintf(os.Stderr, "skipping %s (%d remote digests up-to-date)\n", image, len(remoteDigests))
149154
continue

0 commit comments

Comments
 (0)