diff --git a/pkg/archive/archive_test.go b/pkg/archive/archive_test.go index e144beb27b..c41a9310a9 100644 --- a/pkg/archive/archive_test.go +++ b/pkg/archive/archive_test.go @@ -445,7 +445,6 @@ func testArchive(t *testing.T, when spec.G, it spec.S) { when("hard link files are present", func() { it.Before(func() { - h.SkipIf(t, runtime.GOOS == "windows", "Skipping on windows") src = filepath.Join("testdata", "dir-to-tar-with-hardlink") // create a hard link err := os.Link(filepath.Join(src, "original-file"), filepath.Join(src, "original-file-2")) diff --git a/pkg/archive/archive_windows.go b/pkg/archive/archive_windows.go index 42c1b1f19b..4452897480 100644 --- a/pkg/archive/archive_windows.go +++ b/pkg/archive/archive_windows.go @@ -5,9 +5,13 @@ import ( ) func hasHardlinks(fi os.FileInfo) bool { - return false + return fi.Sys().(*syscall.Stat_t).Nlink > 1 } func getInodeFromStat(stat interface{}) (inode uint64, err error) { + s, ok := stat.(*syscall.Stat_t) + if ok { + inode = s.Ino + } return }