A version control system is about change over time. Today you make the second commit, editing a file and re-staging, and watch the tree, the commit, and the branch all advance with exact ids.
Make a second commit that changes a file and assert the advanced tree, commit, and branch.
Change is the whole point of version control, and here it flows through every
layer cleanly. Editing hello.txt and re-staging produces a new blob 3b18e512...;
write-tree rebuilds only what changed, giving a new root tree 4ab82d44... while
the unchanged README.md blob and src subtree are reused by id; and commit
picks up the first commit as parent, yielding 9bae7f0a... and advancing main.
That reuse is the Merkle DAG earning its keep: identical content is never stored
twice, and unchanged subtrees are shared across commits for free. Log() now walks
the two-commit chain newest first. The repository holds a real, linked history that
real Git can read. The last lesson runs the entire session start to finish and
proves exactly that.
// edit hello.txt on disk to "hello world\n", then:r.Add(ix, "hello.txt") // 3b18e512...id, _ := r.Commit(ix, ident2, "Update greeting\n")// id == "9bae7f0a..."; parent == first commit; Log() == [id, first]