Do not allow to create commits, trees, blobs and tags directly from the
constructor. For instance, now calling "Commit(...)" raises an error.
Instead use the create methods of the repository object:
Before Now
----------------------------- -----------------------------
commit = Commit(repo, ...) sha = repo.create_commit(...)
tag = Tag(repo, ...) sha = repo.create_tag(...)
Most often you won't need to get the object just created, but if you
do just call "repo[sha]" afterwards. (Methods to create blobs and trees
are still missing, just like before.)
Similarly the method that creates a tree object from the index file does
not return the tree object anymore, but just its SHA:
Before Now
----------------------------- -----------------------------
tree = index.create_tree() sha = index.create_tree()