Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit b926b6c

Browse files
committed
Added the source attribute to GHRepository
1 parent 3fb8e5f commit b926b6c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public class GHRepository extends GHObject {
6363

6464
private GHRepoPermission permissions;
6565

66+
private GHRepository source;
67+
6668
public GHDeploymentBuilder createDeployment(String ref) {
6769
return new GHDeploymentBuilder(this,ref);
6870
}
@@ -1107,6 +1109,16 @@ public List<GHDeployKey> getDeployKeys() throws IOException{
11071109
return list;
11081110
}
11091111

1112+
/**
1113+
* Forked repositories have a 'source' attribute that specifies the repository they were forked
1114+
* from.
1115+
* @return The GHRepository instance from the fork source, or null if this
1116+
* GHRepository isn't a fork.
1117+
*/
1118+
public GHRepository getSource() {
1119+
return source;
1120+
}
1121+
11101122
/**
11111123
* Subscribes to this repository to get notifications.
11121124
*/

0 commit comments

Comments
 (0)