Skip to content

Commit f3a3b87

Browse files
committed
Defined entry points
1 parent 9cf6ee7 commit f3a3b87

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private UserInfo(String name, String email, Date date) {
3333
}
3434
}
3535

36-
public GHCommitBuilder(GHRepository repo) {
36+
GHCommitBuilder(GHRepository repo) {
3737
this.repo = repo;
3838
req = new Requester(repo.root);
3939
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,10 @@ public GHTree getTree(String sha) throws IOException {
824824
return root.retrieve().to(url, GHTree.class).wrap(this);
825825
}
826826

827+
public GHTreeBuilder createTree() {
828+
return new GHTreeBuilder(this);
829+
}
830+
827831
/**
828832
* Retrieves the tree for the current GitHub repository, recursively as described in here:
829833
* https://developer.github.com/v3/git/trees/#get-a-tree-recursively
@@ -853,6 +857,10 @@ public GHBlob getBlob(String blobSha) throws IOException {
853857
return root.retrieve().to(target, GHBlob.class);
854858
}
855859

860+
public GHBlobBuilder createBlob() {
861+
return new GHBlobBuilder(this);
862+
}
863+
856864
/**
857865
* Reads the content of a blob as a stream for better efficiency.
858866
*
@@ -876,6 +884,10 @@ public GHCommit getCommit(String sha1) throws IOException {
876884
return c;
877885
}
878886

887+
public GHCommitBuilder createCommit() {
888+
return new GHCommitBuilder(this);
889+
}
890+
879891
/**
880892
* Lists all the commits.
881893
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private TreeEntry(String path, String mode, String type) {
2727
}
2828
}
2929

30-
public GHTreeBuilder(GHRepository repo) {
30+
GHTreeBuilder(GHRepository repo) {
3131
this.repo = repo;
3232
req = new Requester(repo.root);
3333
}

0 commit comments

Comments
 (0)