1
0
Fork 0
mirror of https://github.com/vbatts/dedupe-linker.git synced 2025-07-29 13:30:30 +00:00

*.go: firm up whether it is the same file

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-04-11 14:31:28 -04:00
parent 022dad64e7
commit 2835d1a77d
3 changed files with 23 additions and 16 deletions

View file

@ -53,21 +53,7 @@ type ReadSeekCloser interface {
// SameFile checks whether the object of `sum` address, and `path` file path are the same file.
// This checks by inode and device.
func (b Base) SameFile(sum, path string) bool {
var (
bInode, dInode uint64
err error
)
if bInode, err = file.GetInode(b.blobPath(sum)); err != nil {
return false
}
if dInode, err = file.GetInode(path); err != nil {
return false
}
if bInode == dInode {
return true
}
return false
return file.SameFile(b.blobPath(sum), path)
}
// GetBlob store the content from src, for the sum and hashType