unpack: Fallback to untar when tgz isn't compressed
Created by: tsenart
This commit makes unpack.Tgz
fallback to unpack.Tar
when the input
isn't gzip compressed.
Some npm package tarballs, despite ending with the .tgz
extension,
aren't actually gzip compressed, only tar-ed up.
Example: https://registry.npmjs.org/@types/tmp/-/tmp-0.0.28.tgz
From https://sourcegraph.com/github.com/golang/go@baf61e4a67789e20f019507287a324cca06bed42/-/blob/src/compress/gzip/gunzip.go?L185
Closes #32052 (closed)
Test plan
Integration test.