The finale runs an entire mini-git session end to end and asserts every exact id at once, then confirms the objects it wrote are readable by real Git. Every layer you built proves itself together.
Run a complete init-add-commit-edit-commit session and assert every id, the branch, the log, and a clean status.
This is the promise the whole project was built to keep: a working mini-git.
The script drives every layer at once. init creates the object database;
add stores blobs and stages them; commit writes nested trees and a commit and
advances main; a second edit-add-commit grows a linked history; Log walks the
chain; Status confirms the working tree matches what was committed. Every id, from
the blobs through the trees to both commits, is asserted exact, and they are the
same ids real Git computes.
The final proof is the one that makes it undeniable: the objects your library wrote
are byte-compatible with Git, so pointing real git cat-file -p at your .mygit
object store prints your commits, trees, and blobs perfectly. From an empty
directory you have built the honest heart of Git, a content-addressable object
database, the Merkle DAG of trees and commits, an index, refs, and a symbolic HEAD.
That is a real version control system, and it is yours.
// the whole project in one run: init -> add -> commit -> edit -> add -> commit// assert: both commit ids, both root trees, main == C2, Log == [C2, C1],// Status all unchanged. Then, outside the test:// git --git-dir=<repo>/.mygit cat-file -p 9bae7f0a... reads YOUR commit