mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
cleaning up
This commit is contained in:
@@ -1,50 +1,51 @@
|
||||
package org.kohsuke.github;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A branch in a repository.
|
||||
*
|
||||
* @author Yusuke Kokubo
|
||||
*
|
||||
*/
|
||||
public class GHBranch {
|
||||
GitHub root;
|
||||
GHRepository owner;
|
||||
private GitHub root;
|
||||
private GHRepository owner;
|
||||
|
||||
GHUser creator;
|
||||
private String name;
|
||||
private GHCommitPointer commit;
|
||||
private String name;
|
||||
private Commit commit;
|
||||
|
||||
public GitHub getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
public GHRepository getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public GHUser getCreator() {
|
||||
return creator;
|
||||
}
|
||||
public static class Commit {
|
||||
String sha,url;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public GitHub getRoot() {
|
||||
return root;
|
||||
}
|
||||
|
||||
public GHCommitPointer getCommit() {
|
||||
return commit;
|
||||
}
|
||||
/**
|
||||
* Repository that this branch is in.
|
||||
*/
|
||||
public GHRepository getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Branch:"+name+" in "+owner.getUrl();
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public GHBranch wrap(GHRepository repo) {
|
||||
this.owner = repo;
|
||||
this.root = repo.root;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* The commit that this branch currently points to.
|
||||
*/
|
||||
public String getSHA1() {
|
||||
return commit.sha;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Branch:" + name + " in " + owner.getUrl();
|
||||
}
|
||||
|
||||
/*package*/ GHBranch wrap(GHRepository repo) {
|
||||
this.owner = repo;
|
||||
this.root = repo.root;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@ class JsonBranch {
|
||||
GHBranch branch;
|
||||
|
||||
GHBranch wrap(GHRepository r) {
|
||||
branch.owner = r;
|
||||
branch.root = r.root;
|
||||
return branch;
|
||||
return branch.wrap(r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,10 +33,8 @@ class JsonBranches {
|
||||
List<GHBranch> branches;
|
||||
|
||||
public List<GHBranch> wrap(GHRepository owner) {
|
||||
for (GHBranch branch : branches) {
|
||||
branch.owner = owner;
|
||||
branch.root = owner.root;
|
||||
}
|
||||
for (GHBranch branch : branches)
|
||||
branch.wrap(owner);
|
||||
return branches;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user