File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import java .net .HttpURLConnection ;
44import java .net .URI ;
55import java .net .URL ;
6+ import java .util .Locale ;
7+ import java .util .Objects ;
68import javax .inject .Inject ;
79import org .eclipse .jgit .lib .Config ;
810import org .eclipse .jgit .lib .ConfigConstants ;
@@ -111,12 +113,27 @@ private void checkOrgBranch(File relatedRepoDir) {
111113 }
112114
113115 /**
114- * A pair of {@code org} and {@code branch}
116+ * A pair of {@code org} and {@code branch}. Because GitHub organizations are case-insensitive,
117+ * {@code org} is compared using case-insensitive string comparisons.
115118 *
116119 * @param org a GitHub organization name
117120 * @param branch a branch name
118121 */
119- public record OrgBranch (String org , String branch ) {}
122+ public record OrgBranch (String org , String branch ) {
123+
124+ @ Override
125+ public boolean equals (Object o ) {
126+ if (!(o instanceof OrgBranch other )) {
127+ return false ;
128+ }
129+ return org .equalsIgnoreCase (other .org ) && branch .equals (other .branch );
130+ }
131+
132+ @ Override
133+ public int hashCode () {
134+ return Objects .hash (org .toLowerCase (Locale .ROOT ), branch );
135+ }
136+ }
120137
121138 /**
122139 * Find the org and branch of the remote tracking branch that is currently checked out in {@code
You can’t perform that action at this time.
0 commit comments