This fixes commit dab5ba5a642250dd8c2ddf954f9ffe60837a2e7b.
The for i := 0; i < len(descs); i++ loops inside findDescriptor skip one
entry of descs at each non-match because the array length is reduced by 1
but the index i is not reduced:
skopeo copy docker://ubuntu oci:dir:a
skopeo copy docker://ubuntu oci:dir:b
skopeo copy docker://ubuntu oci:dir:c
./oci-image-tool unpack --ref name=c dir dir2
index.json: descriptor retrieved by refs [name=c] is not unique
This fixes commit dab5ba5a642250dd8c2ddf954f9ffe60837a2e7b.
The
for i := 0; i < len(descs); i++
loops inside findDescriptor skip one entry of descs at each non-match because the array length is reduced by 1 but the index i is not reduced: