Skip to content

Commit

Permalink
removed tap call
Browse files Browse the repository at this point in the history
  • Loading branch information
koriroys committed Aug 14, 2012
1 parent 8a60bbf commit 4e71603
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/octokit/client/commits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ def commit(repo, sha, options={})
# commit.message # => "My commit message"
# commit.committer # => { "name" => "Wynn Netherland", "email" => "[email protected]", ... }
def create_commit(repo, message, tree, parents=nil, options={})
params = { :message => message, :tree => tree }.tap do |params|
params[:parents] = [parents].flatten if parents
end
params = { :message => message, :tree => tree }
params[:parents] = [parents].flatten if parents
post("repos/#{Repository.new(repo)}/git/commits", options.merge(params), 3)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/octokit/client/commits_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

describe ".create_commit" do

it "should create a commit" do
stub_post("/repos/octocat/Hello-World/git/commits").
with(:body => { :message => "My commit message", :tree => "827efc6d56897b048c772eb4087f854f46256132", :parents => ["7d1b31e74ee336d15cbd21741bc88a537ed063a0"] },
Expand Down

0 comments on commit 4e71603

Please sign in to comment.