diff --git a/rootfs/rootfs_test.go b/rootfs/rootfs_test.go index 1c6ec61..9590c78 100644 --- a/rootfs/rootfs_test.go +++ b/rootfs/rootfs_test.go @@ -64,6 +64,21 @@ func TestRootFS(t *testing.T) { file{Name: "/file", Uid: 1, Contents: bytes.NewBufferString("from 1")}, }, }, + { + name: "overwrite file with hardlink", + image: tarball{ + file{Name: "layer0/layer.tar", Contents: tarball{ + file{Name: "a"}, + }}, + file{Name: "layer1/layer.tar", Contents: tarball{ + hardlink{Name: "a"}, + }}, + manifest{"layer0/layer.tar", "layer1/layer.tar"}, + }, + want: []extractable{ + hardlink{Name: "a"}, + }, + }, { name: "directory overwrite retains original dir", image: tarball{