Skip to content

Moving files leads to same hash #1061

@spoorcc

Description

@spoorcc

This test will fail:

def test_hash_directory_differs_for_same_name_in_different_subdirs(tmp_path):
    """Files with identical names but in different sub-directories must affect the hash."""
    d1 = tmp_path / "proj1"
    d1.mkdir()
    (d1 / "a").mkdir()
    (d1 / "a" / "file.txt").write_text("in a")

    d2 = tmp_path / "proj2"
    d2.mkdir()
    (d2 / "b").mkdir()
    (d2 / "b" / "file.txt").write_text("in a")

    assert hash_directory(str(d1), None) != hash_directory(str(d2), None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions