Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

s/rugged/repo in TreeBuilder section.

  • Loading branch information...
commit ebcacac5ab7adf0398d7a7c30e4df94c37baab6e 1 parent 79f0011
@DawidJanczak DawidJanczak authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 README.md
View
8 README.md
@@ -233,20 +233,20 @@ tree.each_blob { |entry| puts entry[:name] } # list only files
You can also write trees with the `TreeBuilder`:
```ruby
-oid = rugged.write("This is a blob.", :blob)
+oid = repo.write("This is a blob.", :blob)
builder = Rugged::Tree::Builder.new
builder << { :type => :blob, :name => "README.md", :oid => oid, :filemode => 0100644 }
options = {}
-options[:tree] = builder.write(rugged)
+options[:tree] = builder.write(repo)
options[:author] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now }
options[:committer] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now }
options[:message] ||= "Making a commit via Rugged!"
-options[:parents] = rugged.empty? ? [] : [ rugged.head.target ].compact
+options[:parents] = repo.empty? ? [] : [ repo.head.target ].compact
options[:update_ref] = 'HEAD'
-Rugged::Commit.create(rugged, options)
+Rugged::Commit.create(repo, options)
```
---
Please sign in to comment.
Something went wrong with that request. Please try again.