Permalink
Browse files

Merge pull request #58 from pda/readme-commit-create-example

README: Rugged::Commit.create() example from rugged_commit.c docs.
  • Loading branch information...
2 parents 40181a6 + 64ba348 commit 5e3f625a0bf18ddee81b297880ad998ef5d41750 @vmg vmg committed Apr 28, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 README.md
View
@@ -161,13 +161,14 @@ commit.parents
You can also write new objects to the database this way:
```ruby
-person = Rugged::Signature.new('Scott', 'schacon@gmail.com', Time.now)
-
-commit = Rugged::Commit.new(repo)
-commit.message = "my message"
-commit.author = person
-commit.tree = commit
-commit.write
+author = {:email=>"tanoku@gmail.com", :time=>Time.now, :name=>"Vicent Mart\303\255"}
+
+Rugged::Commit.create(r,
+ :author => author,
+ :message => "Hello world\n\n",
+ :committer => author,
+ :parents => ["2cb831a8aea28b2c1b9c63385585b864e4d3bad1"],
+ :tree => some_tree) #=> "f148106ca58764adc93ad4e2d6b1d168422b9796"
```
### Tag Objects
@@ -405,4 +406,4 @@ Now that those are installed, you can install Rugged:
## License
-MIT. See LICENSE file.
+MIT. See LICENSE file.

0 comments on commit 5e3f625

Please sign in to comment.