1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

[#92 state:fixed] Added an option to ignore duplicates hardlinking to the same file.

This commit is contained in:
Virgil Dupras
2010-09-25 12:28:34 +02:00
parent 456a835285
commit 0a64d653e1
24 changed files with 415 additions and 61 deletions

View File

@@ -24,6 +24,7 @@ from ..app import DupeGuru as DupeGuruBase
from ..gui.details_panel import DetailsPanel
from ..gui.directory_tree import DirectoryTree
from ..gui.result_table import ResultTable
from ..scanner import ScanType
class DupeGuru(DupeGuruBase):
def __init__(self):
@@ -122,6 +123,19 @@ class TCDupeGuru(TestCase):
app.directories._dirs.append('this is just so Scan() doesnt return 3')
app.start_scanning() # no exception
def test_ignore_hardlink_matches(self):
# If the ignore_hardlink_matches option is set, don't match files hardlinking to the same
# inode.
tmppath = Path(self.tmpdir())
io.open(tmppath + 'myfile', 'w').write('foo')
os.link(str(tmppath + 'myfile'), str(tmppath + 'hardlink'))
app = DupeGuru()
app.directories.add_path(tmppath)
app.scanner.scan_type = ScanType.Contents
app.options['ignore_hardlink_matches'] = True
app.start_scanning()
eq_(len(app.results.groups), 0)
class TCDupeGuru_clean_empty_dirs(TestCase):
cls_tested_module = app