octokit 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +2 -2
- data/lib/octokit/client/commits.rb +19 -3
- data/lib/octokit/version.rb +1 -1
- data/spec/fixtures/v3/merge.json +47 -0
- data/spec/octokit/client/commits_spec.rb +15 -1
- metadata +4 -2
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
-
* [1.
|
4
|
-
* 2012](https://github.com/pengwynn/octokit/compare/v1.9.4...v1.10.0)
|
3
|
+
* [1.11.0 - August 29, 2012](https://github.com/pengwynn/octokit/compare/v1.10.0...v1.11.0)
|
4
|
+
* [1.10.0 - August 8, 2012](https://github.com/pengwynn/octokit/compare/v1.9.4...v1.10.0)
|
5
5
|
* [1.9.4 - August 6, 2012](https://github.com/pengwynn/octokit/compare/v1.9.3...v1.9.4)
|
6
6
|
* [1.9.3 - July 27, 2012](https://github.com/pengwynn/octokit/compare/v1.9.2...v1.9.3)
|
7
7
|
* [1.9.2 - July 25, 2012](https://github.com/pengwynn/octokit/compare/v1.9.1...v1.9.2)
|
@@ -47,9 +47,8 @@ module Octokit
|
|
47
47
|
# commit.message # => "My commit message"
|
48
48
|
# commit.committer # => { "name" => "Wynn Netherland", "email" => "wynn@github.com", ... }
|
49
49
|
def create_commit(repo, message, tree, parents=nil, options={})
|
50
|
-
params = { :message => message, :tree => tree }
|
51
|
-
|
52
|
-
end
|
50
|
+
params = { :message => message, :tree => tree }
|
51
|
+
params[:parents] = [parents].flatten if parents
|
53
52
|
post("repos/#{Repository.new(repo)}/git/commits", options.merge(params), 3)
|
54
53
|
end
|
55
54
|
|
@@ -93,6 +92,23 @@ module Octokit
|
|
93
92
|
get("repos/#{Repository.new(repo)}/compare/#{start}...#{endd}", options, 3)
|
94
93
|
end
|
95
94
|
|
95
|
+
# Merge a branch or sha
|
96
|
+
#
|
97
|
+
# @param repo [String, Hash, Repository] A GitHub repository
|
98
|
+
# @param base [String] The name of the base branch to merge into
|
99
|
+
# @param head [String] The branch or SHA1 to merge
|
100
|
+
# @option options [String] :commit_message The commit message for the merge
|
101
|
+
# @return [Hashie::Mash] A hash representing the comparison
|
102
|
+
# @see http://developer.github.com/v3/repos/merging/
|
103
|
+
def merge(repo, base, head, options={})
|
104
|
+
params = {
|
105
|
+
:base => base,
|
106
|
+
:head => head
|
107
|
+
}.merge(options)
|
108
|
+
post("repos/#{Repository.new(repo)}/merges", params, 3)
|
109
|
+
end
|
110
|
+
|
111
|
+
|
96
112
|
end
|
97
113
|
end
|
98
114
|
end
|
data/lib/octokit/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
{
|
2
|
+
"author": {
|
3
|
+
"gravatar_id": "7e19cd5486b5d6dc1ef90e671ba52ae0",
|
4
|
+
"login": "pengwynn",
|
5
|
+
"url": "https://api.github.com/users/pengwynn",
|
6
|
+
"id": 865,
|
7
|
+
"avatar_url": "https://secure.gravatar.com/avatar/7e19cd5486b5d6dc1ef90e671ba52ae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
|
8
|
+
},
|
9
|
+
"commit": {
|
10
|
+
"author": {
|
11
|
+
"date": "2012-08-29T17:59:52-07:00",
|
12
|
+
"name": "Wynn Netherland",
|
13
|
+
"email": "wynn@github.com"
|
14
|
+
},
|
15
|
+
"tree": {
|
16
|
+
"sha": "574baabd931c510792e65dd11a09ed0bc4df740c",
|
17
|
+
"url": "https://api.github.com/repos/pengwynn/api-sandbox/git/trees/574baabd931c510792e65dd11a09ed0bc4df740c"
|
18
|
+
},
|
19
|
+
"message": "Testing the merge API",
|
20
|
+
"comment_count": 0,
|
21
|
+
"url": "https://api.github.com/repos/pengwynn/api-sandbox/git/commits/4298c8499e0a7a160975adefdecdf9d8a5437095",
|
22
|
+
"committer": {
|
23
|
+
"date": "2012-08-29T17:59:52-07:00",
|
24
|
+
"name": "Wynn Netherland",
|
25
|
+
"email": "wynn@github.com"
|
26
|
+
}
|
27
|
+
},
|
28
|
+
"sha": "4298c8499e0a7a160975adefdecdf9d8a5437095",
|
29
|
+
"parents": [
|
30
|
+
{
|
31
|
+
"sha": "abf4b791145f0b44114e5db96bf548bcd2aa9c6b",
|
32
|
+
"url": "https://api.github.com/repos/pengwynn/api-sandbox/commits/abf4b791145f0b44114e5db96bf548bcd2aa9c6b"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"sha": "ed65f66e1fd65351cf2b63bba905b6571ad98d4b",
|
36
|
+
"url": "https://api.github.com/repos/pengwynn/api-sandbox/commits/ed65f66e1fd65351cf2b63bba905b6571ad98d4b"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
"url": "https://api.github.com/repos/pengwynn/api-sandbox/commits/4298c8499e0a7a160975adefdecdf9d8a5437095",
|
40
|
+
"committer": {
|
41
|
+
"gravatar_id": "7e19cd5486b5d6dc1ef90e671ba52ae0",
|
42
|
+
"login": "pengwynn",
|
43
|
+
"url": "https://api.github.com/users/pengwynn",
|
44
|
+
"id": 865,
|
45
|
+
"avatar_url": "https://secure.gravatar.com/avatar/7e19cd5486b5d6dc1ef90e671ba52ae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png"
|
46
|
+
}
|
47
|
+
}
|
@@ -30,7 +30,7 @@ describe Octokit::Client::Commits do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe ".create_commit" do
|
33
|
-
|
33
|
+
|
34
34
|
it "should create a commit" do
|
35
35
|
stub_post("/repos/octocat/Hello-World/git/commits").
|
36
36
|
with(:body => { :message => "My commit message", :tree => "827efc6d56897b048c772eb4087f854f46256132", :parents => ["7d1b31e74ee336d15cbd21741bc88a537ed063a0"] },
|
@@ -89,4 +89,18 @@ describe Octokit::Client::Commits do
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
describe ".merge" do
|
93
|
+
|
94
|
+
before do
|
95
|
+
stub_post("/repos/pengwynn/api-sandbox/merges").
|
96
|
+
to_return(:body => fixture("v3/merge.json"))
|
97
|
+
end
|
98
|
+
|
99
|
+
it "should merge a branch into another" do
|
100
|
+
merge = @client.merge("pengwynn/api-sandbox", "master", "new-branch", :commit_message => "Testing the merge API")
|
101
|
+
merge.sha.should == '4298c8499e0a7a160975adefdecdf9d8a5437095'
|
102
|
+
merge.commit.message.should == 'Testing the merge API'
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
92
106
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2012-08-
|
14
|
+
date: 2012-08-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: addressable
|
@@ -297,6 +297,7 @@ files:
|
|
297
297
|
- spec/fixtures/v3/languages.json
|
298
298
|
- spec/fixtures/v3/list_commit_comments.json
|
299
299
|
- spec/fixtures/v3/markdown_gfm
|
300
|
+
- spec/fixtures/v3/merge.json
|
300
301
|
- spec/fixtures/v3/milestone.json
|
301
302
|
- spec/fixtures/v3/milestones.json
|
302
303
|
- spec/fixtures/v3/not_found.json
|
@@ -427,6 +428,7 @@ test_files:
|
|
427
428
|
- spec/fixtures/v3/languages.json
|
428
429
|
- spec/fixtures/v3/list_commit_comments.json
|
429
430
|
- spec/fixtures/v3/markdown_gfm
|
431
|
+
- spec/fixtures/v3/merge.json
|
430
432
|
- spec/fixtures/v3/milestone.json
|
431
433
|
- spec/fixtures/v3/milestones.json
|
432
434
|
- spec/fixtures/v3/not_found.json
|