-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec664ab
commit 2e5a947
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.kohsuke.github; | ||
|
||
|
||
import java.io.IOException; | ||
|
||
public class GHRefBuilder { | ||
|
||
private final GHRepository repo; | ||
private final Requester builder; | ||
|
||
public GHRefBuilder(GHRepository ghRepository, String ref, String sha) { | ||
this.repo = ghRepository; | ||
this.builder = new Requester(repo.root); | ||
builder.with("ref", "refs/heads/" +ref); | ||
builder.with("sha", sha); | ||
} | ||
|
||
public void create() throws IOException { | ||
builder.method("POST").to(repo.getApiTailUrl("git/refs")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package org.kohsuke.github; | ||
|
||
|
||
public class GHTag { | ||
private GHRepository owner; | ||
private GitHub root; | ||
|
||
private String name; | ||
private GHCommit commit; | ||
|
||
GHTag wrap(GHRepository owner) { | ||
this.owner = owner; | ||
this.root = owner.root; | ||
return this; | ||
} | ||
|
||
static GHTag[] wrap(GHTag[] tags, GHRepository owner) { | ||
for (GHTag tag : tags) { | ||
tag.wrap(owner); | ||
} | ||
return tags; | ||
} | ||
|
||
|
||
public GHRepository getOwner() { | ||
return owner; | ||
} | ||
|
||
public void setOwner(GHRepository owner) { | ||
this.owner = owner; | ||
} | ||
|
||
public GitHub getRoot() { | ||
return root; | ||
} | ||
|
||
public void setRoot(GitHub root) { | ||
this.root = root; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public GHCommit getCommit() { | ||
return commit; | ||
} | ||
|
||
public void setCommit(GHCommit commit) { | ||
this.commit = commit; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters