We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ea5d7c commit 6ce878fCopy full SHA for 6ce878f
1 file changed
src/main/java/com/cloudbees/jenkins/GitHubRepositoryName.java
@@ -90,6 +90,18 @@ protected GHRepository adapt(GitHub item) {
90
};
91
}
92
93
+ /**
94
+ * Variation of {@link #resolve()} method that just returns the first valid repository object.
95
+ *
96
+ * This is useful if the caller only relies on the read access to the repository and doesn't need to
97
+ * walk possible candidates.
98
+ */
99
+ public GHRepository resolveOne() {
100
+ for (GHRepository r : resolve())
101
+ return r;
102
+ return null;
103
+ }
104
+
105
private <V> Iterator<V> filterNull(Iterator<V> itr) {
106
return new FilterIterator<V>(itr) {
107
@Override
0 commit comments