Does anyone know how to create a commit using the ruby bindings (the 'rugged' gem) for libgit2? I've tried all the examples I can find, on the libgit2 usage guide and on the rugged gem github page, and none of the exampes for creating or editing a commit are working.
This has been helpful in trying to figure out how to commit so far, except it's for libgit2 itself and not the ruby bindings. http://librelist.com/browser//libgit2/2011/2/19/initing-a-repository-adding-files-to-the-index-and-committing/#d94ce8df18ff0202ce904180286a4a85
When I try and make a commit, following the steps on the Rugged Github page, I get this;
pry(main)> Rugged::Commit.create( repo, :author=>author, :message=>"Hello world\n\n", :committer=>author, :parents=>parents, :tree=>tree )
TypeError: wrong argument type nil (expected String)
And when I try to follow the libgit2 usage guide, which basically says to get the commit and then just edit it using commit.message=
like commands, but then I get noMethodErrors because there is no 'message=' method.
libgit2 usage guide: http://libgit2.github.com/api.html
Rugged documentation 0: http://rubydoc.info/gems/rugged/0.16.0/frames
Rugged Github page: https://github.com/libgit2/rugged
Edit: How I reproduce this; http://pastebin.com/wnta8FWm
Edit_n+1: I also tried using the sha of the tree instead of a Rugged::Tree object, by trying
x=Rugged::Commit.create( repo, :author=>author, :message=>"Hello world\n\n", :committer=>author, :parents=>parents, :tree=>tree.oid )
But that just produced the exact same error output as before.