Skip to content

Commit b875cce

Browse files
committed
Reverse removal of misnamed gitHttpTransportUrl
1 parent 410bac2 commit b875cce

File tree

6 files changed

+116
-90
lines changed

6 files changed

+116
-90
lines changed

src/main/java/org/kohsuke/github/GHRepository.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ public String getHttpTransportUrl() {
221221
return clone_url;
222222
}
223223

224+
/**
225+
* Git http transport url string.
226+
*
227+
* @return the string
228+
* @deprecated Typo of {@link #getHttpTransportUrl()}
229+
*/
230+
@Deprecated
231+
public String gitHttpTransportUrl() {
232+
return clone_url;
233+
}
234+
224235
/**
225236
* Gets the Subversion URL to access this repository: https://github.com/rails/rails
226237
*

src/test/java/org/kohsuke/github/GHRepositoryTest.java

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ private GHRepository getRepository(GitHub gitHub) throws IOException {
2626
return gitHub.getOrganization("github-api-test-org").getRepository("github-api");
2727
}
2828

29+
@Test
30+
public void testGetters() throws IOException {
31+
GHRepository r = getTempRepository();
32+
33+
assertThat(r.hasAdminAccess(), is(true));
34+
assertThat(r.hasDownloads(), is(true));
35+
assertThat(r.hasIssues(), is(true));
36+
assertThat(r.hasPages(), is(false));
37+
assertThat(r.hasProjects(), is(true));
38+
assertThat(r.hasPullAccess(), is(true));
39+
assertThat(r.hasPushAccess(), is(true));
40+
assertThat(r.hasWiki(), is(true));
41+
42+
assertThat(r.isAllowMergeCommit(), is(true));
43+
assertThat(r.isAllowRebaseMerge(), is(true));
44+
assertThat(r.isAllowSquashMerge(), is(true));
45+
46+
String httpTransport = "https://github.com/github-api-test-org/temp-testGetters.git";
47+
assertThat(r.getHttpTransportUrl(), equalTo(httpTransport));
48+
assertThat(r.gitHttpTransportUrl(), equalTo(httpTransport));
49+
50+
assertThat(r.getName(), equalTo("temp-testGetters"));
51+
assertThat(r.getFullName(), equalTo("github-api-test-org/temp-testGetters"));
52+
}
53+
2954
@Test
3055
public void archive() throws Exception {
3156
snapshotNotAllowed();
@@ -274,14 +299,6 @@ public void markDown() throws Exception {
274299
assertTrue(actual.contains("to fix issue"));
275300
}
276301

277-
@Test
278-
public void getMergeOptions() throws IOException {
279-
GHRepository r = getTempRepository();
280-
assertNotNull(r.isAllowMergeCommit());
281-
assertNotNull(r.isAllowRebaseMerge());
282-
assertNotNull(r.isAllowSquashMerge());
283-
}
284-
285302
@Test
286303
public void setMergeOptions() throws IOException {
287304
// String repoName = "github-api-test-org/test-mergeoptions";
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"id": 214018468,
3-
"node_id": "MDEwOlJlcG9zaXRvcnkyMTQwMTg0Njg=",
4-
"name": "temp-getMergeOptions",
5-
"full_name": "github-api-test-org/temp-getMergeOptions",
2+
"id": 253555338,
3+
"node_id": "MDEwOlJlcG9zaXRvcnkyNTM1NTUzMzg=",
4+
"name": "temp-testGetters",
5+
"full_name": "github-api-test-org/temp-testGetters",
66
"private": false,
77
"owner": {
88
"login": "github-api-test-org",
@@ -24,53 +24,53 @@
2424
"type": "Organization",
2525
"site_admin": false
2626
},
27-
"html_url": "https://github.com/github-api-test-org/temp-getMergeOptions",
28-
"description": "A test repository for testing the github-api project: temp-getMergeOptions",
27+
"html_url": "https://github.com/github-api-test-org/temp-testGetters",
28+
"description": "A test repository for testing the github-api project: temp-testGetters",
2929
"fork": false,
30-
"url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions",
31-
"forks_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/forks",
32-
"keys_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/keys{/key_id}",
33-
"collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/collaborators{/collaborator}",
34-
"teams_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/teams",
35-
"hooks_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/hooks",
36-
"issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/issues/events{/number}",
37-
"events_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/events",
38-
"assignees_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/assignees{/user}",
39-
"branches_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/branches{/branch}",
40-
"tags_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/tags",
41-
"blobs_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/git/blobs{/sha}",
42-
"git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/git/tags{/sha}",
43-
"git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/git/refs{/sha}",
44-
"trees_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/git/trees{/sha}",
45-
"statuses_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/statuses/{sha}",
46-
"languages_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/languages",
47-
"stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/stargazers",
48-
"contributors_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/contributors",
49-
"subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/subscribers",
50-
"subscription_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/subscription",
51-
"commits_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/commits{/sha}",
52-
"git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/git/commits{/sha}",
53-
"comments_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/comments{/number}",
54-
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/issues/comments{/number}",
55-
"contents_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/contents/{+path}",
56-
"compare_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/compare/{base}...{head}",
57-
"merges_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/merges",
58-
"archive_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/{archive_format}{/ref}",
59-
"downloads_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/downloads",
60-
"issues_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/issues{/number}",
61-
"pulls_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/pulls{/number}",
62-
"milestones_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/milestones{/number}",
63-
"notifications_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/notifications{?since,all,participating}",
64-
"labels_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/labels{/name}",
65-
"releases_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/releases{/id}",
66-
"deployments_url": "https://api.github.com/repos/github-api-test-org/temp-getMergeOptions/deployments",
67-
"created_at": "2019-10-09T20:35:11Z",
68-
"updated_at": "2019-10-09T20:35:16Z",
69-
"pushed_at": "2019-10-09T20:35:13Z",
70-
"git_url": "git://github.com/github-api-test-org/temp-getMergeOptions.git",
71-
"ssh_url": "[email protected]:github-api-test-org/temp-getMergeOptions.git",
72-
"clone_url": "https://github.com/github-api-test-org/temp-getMergeOptions.git",
73-
"svn_url": "https://github.com/github-api-test-org/temp-getMergeOptions",
30+
"url": "https://api.github.com/repos/github-api-test-org/temp-testGetters",
31+
"forks_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/forks",
32+
"keys_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/keys{/key_id}",
33+
"collaborators_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/collaborators{/collaborator}",
34+
"teams_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/teams",
35+
"hooks_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/hooks",
36+
"issue_events_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/issues/events{/number}",
37+
"events_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/events",
38+
"assignees_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/assignees{/user}",
39+
"branches_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/branches{/branch}",
40+
"tags_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/tags",
41+
"blobs_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/git/blobs{/sha}",
42+
"git_tags_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/git/tags{/sha}",
43+
"git_refs_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/git/refs{/sha}",
44+
"trees_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/git/trees{/sha}",
45+
"statuses_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/statuses/{sha}",
46+
"languages_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/languages",
47+
"stargazers_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/stargazers",
48+
"contributors_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/contributors",
49+
"subscribers_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/subscribers",
50+
"subscription_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/subscription",
51+
"commits_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/commits{/sha}",
52+
"git_commits_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/git/commits{/sha}",
53+
"comments_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/comments{/number}",
54+
"issue_comment_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/issues/comments{/number}",
55+
"contents_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/contents/{+path}",
56+
"compare_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/compare/{base}...{head}",
57+
"merges_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/merges",
58+
"archive_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/{archive_format}{/ref}",
59+
"downloads_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/downloads",
60+
"issues_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/issues{/number}",
61+
"pulls_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/pulls{/number}",
62+
"milestones_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/milestones{/number}",
63+
"notifications_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/notifications{?since,all,participating}",
64+
"labels_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/labels{/name}",
65+
"releases_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/releases{/id}",
66+
"deployments_url": "https://api.github.com/repos/github-api-test-org/temp-testGetters/deployments",
67+
"created_at": "2020-04-06T16:31:08Z",
68+
"updated_at": "2020-04-06T16:31:12Z",
69+
"pushed_at": "2020-04-06T16:31:10Z",
70+
"git_url": "git://github.com/github-api-test-org/temp-testGetters.git",
71+
"ssh_url": "[email protected]:github-api-test-org/temp-testGetters.git",
72+
"clone_url": "https://github.com/github-api-test-org/temp-testGetters.git",
73+
"svn_url": "https://github.com/github-api-test-org/temp-testGetters",
7474
"homepage": "http://github-api.kohsuke.org/",
7575
"size": 0,
7676
"stargazers_count": 0,
@@ -96,9 +96,11 @@
9696
"push": true,
9797
"pull": true
9898
},
99+
"temp_clone_token": "",
99100
"allow_squash_merge": true,
100101
"allow_merge_commit": true,
101102
"allow_rebase_merge": true,
103+
"delete_branch_on_merge": false,
102104
"organization": {
103105
"login": "github-api-test-org",
104106
"id": 7544739,
@@ -120,5 +122,5 @@
120122
"site_admin": false
121123
},
122124
"network_count": 0,
123-
"subscribers_count": 4
125+
"subscribers_count": 7
124126
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
"email": "[email protected]",
2525
"hireable": null,
2626
"bio": "https://twitter.com/bitwiseman",
27-
"public_repos": 168,
28-
"public_gists": 5,
29-
"followers": 136,
27+
"public_repos": 181,
28+
"public_gists": 7,
29+
"followers": 153,
3030
"following": 9,
3131
"created_at": "2012-07-11T20:38:33Z",
32-
"updated_at": "2019-09-24T19:32:29Z",
33-
"private_gists": 7,
34-
"total_private_repos": 9,
32+
"updated_at": "2020-04-05T15:30:16Z",
33+
"private_gists": 8,
34+
"total_private_repos": 10,
3535
"owned_private_repos": 0,
3636
"disk_usage": 33697,
3737
"collaborators": 0,
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"id": "cb893c1a-1c74-4838-b473-342f8c2b8262",
3-
"name": "repos_github-api-test-org_temp-getmergeoptions",
2+
"id": "51e75a28-dbf0-40f0-bd3b-05744a48112f",
3+
"name": "repos_github-api-test-org_temp-testgetters",
44
"request": {
5-
"url": "/repos/github-api-test-org/temp-getMergeOptions",
5+
"url": "/repos/github-api-test-org/temp-testGetters",
66
"method": "GET",
77
"headers": {
88
"Accept": {
@@ -12,37 +12,35 @@
1212
},
1313
"response": {
1414
"status": 200,
15-
"bodyFileName": "repos_github-api-test-org_temp-getmergeoptions-2.json",
15+
"bodyFileName": "repos_github-api-test-org_temp-testgetters-2.json",
1616
"headers": {
17-
"Date": "Wed, 09 Oct 2019 20:35:17 GMT",
17+
"Date": "Mon, 06 Apr 2020 16:31:13 GMT",
1818
"Content-Type": "application/json; charset=utf-8",
1919
"Server": "GitHub.com",
2020
"Status": "200 OK",
2121
"X-RateLimit-Limit": "5000",
22-
"X-RateLimit-Remaining": "4779",
23-
"X-RateLimit-Reset": "1570656117",
22+
"X-RateLimit-Remaining": "4946",
23+
"X-RateLimit-Reset": "1586193591",
2424
"Cache-Control": "private, max-age=60, s-maxage=60",
2525
"Vary": [
2626
"Accept, Authorization, Cookie, X-GitHub-OTP",
27-
"Accept-Encoding"
27+
"Accept-Encoding, Accept, X-Requested-With"
2828
],
29-
"ETag": "W/\"8cf8d178089529a31ec118053dfb2e26\"",
30-
"Last-Modified": "Wed, 09 Oct 2019 20:35:16 GMT",
29+
"ETag": "W/\"907cf28e782c79c9642ee5220a601c46\"",
30+
"Last-Modified": "Mon, 06 Apr 2020 16:31:12 GMT",
3131
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
3232
"X-Accepted-OAuth-Scopes": "repo",
3333
"X-GitHub-Media-Type": "unknown, github.v3",
34-
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
35-
"Access-Control-Allow-Origin": "*",
3634
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
3735
"X-Frame-Options": "deny",
3836
"X-Content-Type-Options": "nosniff",
3937
"X-XSS-Protection": "1; mode=block",
4038
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
4139
"Content-Security-Policy": "default-src 'none'",
42-
"X-GitHub-Request-Id": "CC9F:3044:A907C9:1358197:5D9E447F"
40+
"X-GitHub-Request-Id": "C0E8:741A:38FD8:45614:5E8B594B"
4341
}
4442
},
45-
"uuid": "cb893c1a-1c74-4838-b473-342f8c2b8262",
43+
"uuid": "51e75a28-dbf0-40f0-bd3b-05744a48112f",
4644
"persistent": true,
4745
"insertionIndex": 2
4846
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"id": "5d8fe237-9241-4331-8808-0ca2781e48be",
2+
"id": "4594ed8b-ad86-46e5-bdce-92a0089e4cef",
33
"name": "user",
44
"request": {
55
"url": "/user",
@@ -14,35 +14,33 @@
1414
"status": 200,
1515
"bodyFileName": "user-1.json",
1616
"headers": {
17-
"Date": "Wed, 09 Oct 2019 20:35:11 GMT",
17+
"Date": "Mon, 06 Apr 2020 16:31:07 GMT",
1818
"Content-Type": "application/json; charset=utf-8",
1919
"Server": "GitHub.com",
2020
"Status": "200 OK",
2121
"X-RateLimit-Limit": "5000",
22-
"X-RateLimit-Remaining": "4787",
23-
"X-RateLimit-Reset": "1570656117",
22+
"X-RateLimit-Remaining": "4951",
23+
"X-RateLimit-Reset": "1586193591",
2424
"Cache-Control": "private, max-age=60, s-maxage=60",
2525
"Vary": [
2626
"Accept, Authorization, Cookie, X-GitHub-OTP",
27-
"Accept-Encoding"
27+
"Accept-Encoding, Accept, X-Requested-With"
2828
],
29-
"ETag": "W/\"f10545b81d574e5b3170d6ee67e622c7\"",
30-
"Last-Modified": "Tue, 24 Sep 2019 19:32:29 GMT",
29+
"ETag": "W/\"2bd6b233a833d556f43f68fd5daa36d6\"",
30+
"Last-Modified": "Sun, 05 Apr 2020 15:30:16 GMT",
3131
"X-OAuth-Scopes": "admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user, write:discussion",
3232
"X-Accepted-OAuth-Scopes": "",
3333
"X-GitHub-Media-Type": "unknown, github.v3",
34-
"Access-Control-Expose-Headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type",
35-
"Access-Control-Allow-Origin": "*",
3634
"Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload",
3735
"X-Frame-Options": "deny",
3836
"X-Content-Type-Options": "nosniff",
3937
"X-XSS-Protection": "1; mode=block",
4038
"Referrer-Policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
4139
"Content-Security-Policy": "default-src 'none'",
42-
"X-GitHub-Request-Id": "CC9F:3044:A90701:135818B:5D9E447E"
40+
"X-GitHub-Request-Id": "C0E8:741A:38F4E:45610:5E8B594B"
4341
}
4442
},
45-
"uuid": "5d8fe237-9241-4331-8808-0ca2781e48be",
43+
"uuid": "4594ed8b-ad86-46e5-bdce-92a0089e4cef",
4644
"persistent": true,
4745
"insertionIndex": 1
4846
}

0 commit comments

Comments
 (0)