> If you return CAutoRepository, call constructor twice?
yeah, haven't thought about that. I'm just returning git_repository * in order to deduplicate code..

> Do you want to mimic the old style for libgit?
Right now we create a new git_repository for "every task", i.e. it can happen that we open/close the repository several times (e.g. if we call GetHash 3 times in a row) - everytime libgit2 performs sanity checks. For now I don't see performance issues, it could just be another optimization.
But I think we run into several problems. E.g. if we use git_config_write old/cached config values could be written to disk. Open handles could block TGitCache and/or the Commit Dialog when it performs update-index.

This has to be decided very carefully.