I read this Git Internals and a few things about tree-object are not very clear.
For intance, the current branch is master. The final commit object on master is an empty commit and is denoted by cmt_end. Given by git-commit-tree, a commit object has only one tree object. Hence, the tree object of cmt_end is denoted by tree_end.
My confusion is:
- Given by
git-commit,git-commitrecords changes in repository. Does this indicates thattree_endcontains the differences betweencmt_endand its parent? If so,tree_endshould be an empty tree sincecmt_endis an empty commit. If not, is it ok to have an empty tree for the empty commit? - the
--allow-emptyoption ingit-commit, says that an empty commit has the exact same tree as its sole parent commit. Does this indicates that the tree object of a commit records the whole working directory instead of changes when doinggit-commit?