Revamp libgit2 owner interface. (#20786)
It seems that some objects can be owned by non-repo objects. This makes the code a bit more general to allow for this.
* Make GitTreeEntry always have a reference to the GitTree, get rid of unnecessary repo arguments