diff --git a/src/cmds/restic/integration_helpers_test.go b/src/cmds/restic/integration_helpers_test.go index d439d5542..ca7abec5c 100644 --- a/src/cmds/restic/integration_helpers_test.go +++ b/src/cmds/restic/integration_helpers_test.go @@ -35,16 +35,21 @@ func walkDir(dir string) <-chan *dirEntry { return nil } - stat, ok := restic.ToStatT(info.Sys()) + links := 1 + if runtime.GOOS != "windows" { + stat, ok := restic.ToStatT(info.Sys()) - if !ok { - return nil + if !ok { + return nil + } + + links = stat.nlink() } - + ch <- &dirEntry{ path: name, fi: info, - link: stat.nlink(), + link: links, } return nil diff --git a/src/cmds/restic/integration_helpers_unix_test.go b/src/cmds/restic/integration_helpers_unix_test.go index a182898e8..01c33c7af 100644 --- a/src/cmds/restic/integration_helpers_unix_test.go +++ b/src/cmds/restic/integration_helpers_unix_test.go @@ -36,6 +36,11 @@ func (e *dirEntry) equals(other *dirEntry) bool { fmt.Fprintf(os.Stderr, "%v: GID does not match (%v != %v)\n", e.path, stat.Gid, stat2.Gid) return false } + + if stat.nlink() != stat2.nlink() { + fmt.Fprintf(os.Stderr, "%v: Number of links doe not match (%v != %v)\n", e.path, stat.nlink(), stat2.nlink()) + return false + } return true }