FA-75782 / Text diff and three-way merge / Member archive
Tree listing diff: entries after the shorter listing ends are ignored · case 02
Files added or deleted at the end of the directory are missing from the diff.
Case contract
Compare two tree listings of [name, mode, hash]. Entries are ordered by name, with directories (mode 040000) compared as name + "/". Walk both in that order: entries only in the old tree are "D", only in the new tree "A". Entries matched by sort key report "T" when the mode type (first two digits) differs, else "M" when the hash or mode differs. Return [status, name] rows.
Why this case matters
Tree diffs drive status, rename detection and checkout; their ordering and type-change rules follow the object-store conventions.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| file replaced by a directory of the same name | [["D", "x"]] | [["D", "x"], ["A", "x"]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗