Rugged::Walker gives wrong argument type Rugged::Commit (expected Data)
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19] rugged 1.1.0
The Rugged::Walker#push method is supposed to accept an oid string or a Rugged::Commit instance according to the docs: https://www.rubydoc.info/gems/rugged/Rugged/Walker#push-instance_method
However, we're seeing TypeError: wrong argument type Rugged::Commit (expected Data) when we try to pass a Rugged::Commit instance.
We can fix this by specifying the #oid, but I wanted to verify that this is expected behavior.
Related to https://github.com/prontolabs/pronto/pull/380
@carlosmn I also ran into this issue:
require 'rugged'
repository = Rugged::Repository.discover(Dir.pwd)
Rugged::Walker.walk(repository, show: repository.head.target) do |walker|
walker.each do |commit|
puts commit.oid
end
end
Well the code does seem to want accept a git object. It looks like maybe the rb_obj_is_kind_of(rb_commit, rb_cRuggedObject) check is returning false which is why we'd hit the Check_Type(rb_commit, T_STRING); that seems to be triggering this.
Nope, it looks like it was a leftover Data_Get_Struct when it should have been TypedData_Get_Struct.
That might explain the segfaults I was getting :)