| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks a lot, this looks very good to me! It's a bit sad that we have some test duplication to validate various types, but I guess it's better than not having them. |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR extends the Tree.join and Tree.__truediv__ API to support pathlike objects (such as pathlib.Path), enabling more Pythonic path handling when traversing Git tree objects. Previously, users had to explicitly convert Path objects to strings; now they can use them directly with the / operator.
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| git/objects/tree.py | Updated join() and __truediv__() methods to accept PathLike parameters; added os.fspath() conversion; imported os module |
| test/test_tree.py | Added comprehensive test cases for string and PathLike path lookups covering simple, nested, folder, and invalid path scenarios; imported pytest, Repo, and PathLikeMock |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Rename blob to tree Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This extends the Tree.join and Tree.__truediv__ API to allow a pathlike object.
For example:
This did not work before without explicitly converting the Path to a string, but works now.