Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
benri committed Mar 16, 2023
1 parent 469bd9e commit cebee1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion archive/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func Extract(tr TarReader) error {
}
case tar.TypeXGlobalHeader:
// ignore PAX Global Extended Headers
return nil
continue
default:
return fmt.Errorf("unknown file type in tar %d", hdr.Typeflag)
}
Expand Down
5 changes: 5 additions & 0 deletions archive/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ func newFakeTarReader(t *testing.T) (*archive.NormalizingTarReader, string) {
}

func pushHeaders(ftr *fakeTarReader) {
ftr.pushHeader(&tar.Header{
Name: "pax_global_header",
Typeflag: tar.TypeXGlobalHeader,
Mode: int64(0),
})
ftr.pushHeader(&tar.Header{
Name: "root/symlinkdir",
Typeflag: tar.TypeSymlink,
Expand Down

0 comments on commit cebee1d

Please sign in to comment.