This is an automated email from the ASF dual-hosted git repository.

neilcsmith pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new c9c2ebf309 Fix Git show history regression.
     new 85b63563d6 Merge pull request #6594 from 
mbien/fix-git-history-regression
c9c2ebf309 is described below

commit c9c2ebf309ad8ce7ada39bc46f41090e0abadae6
Author: Michael Bien <[email protected]>
AuthorDate: Thu Oct 19 19:52:57 2023 +0200

    Fix Git show history regression.
    
    It appears RevWalk can create 24 flags, LogCommand could create 25 and
    the history view would fail. This tries to maintain the limit of 24.
    
    It is not clear why this worked in past, since the limit was there
    before too.
---
 .../src/org/netbeans/libs/git/jgit/commands/LogCommand.java         | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/ide/libs.git/src/org/netbeans/libs/git/jgit/commands/LogCommand.java 
b/ide/libs.git/src/org/netbeans/libs/git/jgit/commands/LogCommand.java
index cb9460b80d..f3432c04e2 100644
--- a/ide/libs.git/src/org/netbeans/libs/git/jgit/commands/LogCommand.java
+++ b/ide/libs.git/src/org/netbeans/libs/git/jgit/commands/LogCommand.java
@@ -210,8 +210,8 @@ public class LogCommand extends GitCommand {
                     }
                 } else {
                     usedFlags.add(flagId);
-                    if (i < 25) {
-                        i = i + 1;
+                    if (i <= 23) { // leave one spare flag for the run method, 
see RevWalk.newFlag()
+                        i++;
                         RevFlag flag = walk.newFlag(flagId);
                         List<GitBranch> branches = new 
ArrayList<>(allBranches.size());
                         branches.add(e.getValue());
@@ -253,7 +253,7 @@ public class LogCommand extends GitCommand {
     }
 
     public GitRevisionInfo[] getRevisions () {
-        return revisions.toArray(new GitRevisionInfo[revisions.size()]);
+        return revisions.toArray(new GitRevisionInfo[0]);
     }
 
     private void addRevision (GitRevisionInfo info) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to