Skip to content

Commit 4fbbbb3

Browse files
committed
Limit JGit to search 23 branches instead of 24
JGit 7.5.0 has allocated UNSHALLOW as a new global RevFlag. That reduces the available number of flags that API consumers can use for searches.
1 parent cab816d commit 4fbbbb3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,10 +2714,11 @@ public List<Branch> getBranchesContaining(String revspec, boolean allBranches)
27142714
}
27152715
RevCommit target = walk.parseCommit(id);
27162716

2717-
// we can track up to 24 flags at a time in JGit, so that's how many branches we will traverse in every
2718-
// iteration
2719-
List<RevFlag> flags = new ArrayList<>(24);
2720-
for (int i = 0; i < 24; i++) {
2717+
// we can track up to 23 flags at a time in JGit, so that's how many branches we will traverse in every
2718+
// iteration. Changed from 24 to 23 in JGit 7.5.0 with the additional of the global UNSHALLOW
2719+
final int MAX_FLAGS = 23;
2720+
List<RevFlag> flags = new ArrayList<>(MAX_FLAGS);
2721+
for (int i = 0; i < MAX_FLAGS; i++) {
27212722
flags.add(walk.newFlag("branch" + i));
27222723
}
27232724
walk.carry(flags);

0 commit comments

Comments
 (0)