Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7cbd7f9

Browse filesBrowse files
committed
Pointless to define a builder that doesn't take parameters
1 parent 4340c8c commit 7cbd7f9
Copy full SHA for 7cbd7f9

File tree

Expand file treeCollapse file tree

3 files changed

+20
-48
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+20
-48
lines changed

‎src/main/java/org/kohsuke/github/GHRefBuilder.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRefBuilder.java
-22Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRepository.java
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,20 @@ public GHReleaseBuilder createRelease(String tag) {
178178
return new GHReleaseBuilder(this,tag);
179179
}
180180

181+
/**
182+
* Creates a named ref, such as tag, branch, etc.
183+
*
184+
* @param name
185+
* The name of the fully qualified reference (ie: refs/heads/master).
186+
* If it doesn't start with 'refs' and have at least two slashes, it will be rejected.
187+
* @param sha
188+
* The SHA1 value to set this reference to
189+
*/
190+
public GHRef createRef(String name, String sha) throws IOException {
191+
return new Requester(root)
192+
.with("ref", name).with("sha", sha).method("POST").to(getApiTailUrl("git/refs"), GHRef.class);
193+
}
194+
181195
/**
182196
* @deprecated
183197
* use {@link #listReleases()}
+6-26Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,36 @@
11
package org.kohsuke.github;
22

3-
3+
/**
4+
* Represents a tag in {@link GHRepository}
5+
*
6+
* @see GHRepository#listTags()
7+
*/
48
public class GHTag {
59
private GHRepository owner;
610
private GitHub root;
711

812
private String name;
913
private GHCommit commit;
1014

11-
GHTag wrap(GHRepository owner) {
15+
/*package*/ GHTag wrap(GHRepository owner) {
1216
this.owner = owner;
1317
this.root = owner.root;
1418
return this;
1519
}
1620

17-
static GHTag[] wrap(GHTag[] tags, GHRepository owner) {
18-
for (GHTag tag : tags) {
19-
tag.wrap(owner);
20-
}
21-
return tags;
22-
}
23-
24-
2521
public GHRepository getOwner() {
2622
return owner;
2723
}
2824

29-
public void setOwner(GHRepository owner) {
30-
this.owner = owner;
31-
}
32-
3325
public GitHub getRoot() {
3426
return root;
3527
}
3628

37-
public void setRoot(GitHub root) {
38-
this.root = root;
39-
}
40-
4129
public String getName() {
4230
return name;
4331
}
4432

45-
public void setName(String name) {
46-
this.name = name;
47-
}
48-
4933
public GHCommit getCommit() {
5034
return commit;
5135
}
52-
53-
public void setCommit(GHCommit commit) {
54-
this.commit = commit;
55-
}
5636
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.