Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

README: Rugged::Commit.create() example from rugged_commit.c docs.

  • Loading branch information...
commit 64ba3484f58b05387607c4ba184aef7508f3767f 1 parent 40181a6
@pda pda authored
Showing with 9 additions and 8 deletions.
  1. +9 −8 README.md
View
17 README.md
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.