Skip to content

Commit

Permalink
trying to check what happen on window
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbustamante committed Nov 8, 2023
1 parent 879e1da commit d62087f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/archive/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
6 changes: 5 additions & 1 deletion pkg/archive/archive_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit d62087f

Please sign in to comment.