Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
s/rugged/repo in TreeBuilder section.
  • Loading branch information
DawidJanczak committed Mar 23, 2013
1 parent 79f0011 commit ebcacac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -233,20 +233,20 @@ tree.each_blob { |entry| puts entry[:name] } # list only files
You can also write trees with the `TreeBuilder`: You can also write trees with the `TreeBuilder`:


```ruby ```ruby
oid = rugged.write("This is a blob.", :blob) oid = repo.write("This is a blob.", :blob)
builder = Rugged::Tree::Builder.new builder = Rugged::Tree::Builder.new
builder << { :type => :blob, :name => "README.md", :oid => oid, :filemode => 0100644 } builder << { :type => :blob, :name => "README.md", :oid => oid, :filemode => 0100644 }


options = {} options = {}
options[:tree] = builder.write(rugged) options[:tree] = builder.write(repo)


options[:author] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now } 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[:committer] = { :email => "testuser@github.com", :name => 'Test Author', :time => Time.now }
options[:message] ||= "Making a commit via Rugged!" 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' options[:update_ref] = 'HEAD'


Rugged::Commit.create(rugged, options) Rugged::Commit.create(repo, options)
``` ```


--- ---
Expand Down

0 comments on commit ebcacac

Please sign in to comment.