Improves path handling in LibGit2, also defines show method for GitRepo. (#19664)
* Improves path handling in LibGit2, also defines show method for GitRepo.
Defines a `workdir` function, uses this to define `path` in a more principled way, and a show method.
* Define LibGit2.path not in terms of working tree.
* add posixpath function
* spelling