Convenience API and bug fixes for git tree walking#25432
Conversation
| GitHash(ccall((:git_object_id, :libgit2), Ptr{UInt8}, (Ptr{Cvoid},), obj.ptr)) | ||
| end | ||
|
|
||
| ==(obj1::GitObject, obj2::GitObject) = GitHash(obj1) == GitHash(obj2) |
There was a problem hiding this comment.
This seemed like a reasonable thing to do, but is not really required for this PR (it simplifies a test).
There was a problem hiding this comment.
It seems reasonable to me as well, so long as there's a test for it. 🙂
base/libgit2/tree.jl
Outdated
| end | ||
|
|
||
| """ | ||
| getindex(tree::GitTree, target::AbstractString)::GitHash |
There was a problem hiding this comment.
Base still uses -> to show return types in docstrings
There was a problem hiding this comment.
Partly historical artifact, partly because it's often used in such a way that the :: T return type syntax would be wrong or inappropriate.
0a16f68 to
a0e9e40
Compare
|
Bump? Comments have been addressed. Or should this wait until after 1.0? |
|
No, this can be merged now if someone familiar with the LibGit2 code takes a look at it. Maybe @kshyatt? |
base/libgit2/tree.jl
Outdated
| """ | ||
| getindex(tree::GitTree, target::AbstractString) -> GitObject | ||
|
|
||
| Look up `target` path in the `tree`, returning a `GitObject` (a `GitBlob` in the case of a |
kshyatt
left a comment
There was a problem hiding this comment.
other than the minor request to xref docs this lgtm sorry for the wait on the review
|
OK, addressed all comments. Will merge if CI is green. |
|
AppVeyor failures where libgit2 remote exceptions. I've restarted them to make sure they're not actually related since this change does touch libgit2 code. Suspiciously, the Travis Linux 64 failure was also a libgit2 remote exception. I've restarted that one as well, so we'll see... |
|
I'll look into it if any more suspicious failures turn up, after all I've also rebased the branch which might have introduced something. |
|
So this keeps throwing the I'll set-up a windows system tomorrow and debug this. |
|
You can also RDP to an appveyor job: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/ |
|
OK, this was a bug on Windows indeed: I was using Only remaining CI failure is a seemingly unrelated ProcessExitedException on CircleCI; @KristofferC is it OK if I merge this before #25706? |
I've rebased #25706 N times, so rebasing it N+1 times is no problem. |
This PR fixes a bug with LibGit2's
treewalkwrapper, and adds a conveniencegetindex-based API for accessing objects in a tree by path. First time working with libgit2(.jl), so feel free to bikeshed 🙂EDIT: I only ran the
libgit2tests locally because of the device I'm working on, so this might cause test failures.