Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22343

JGitAPIImpl fails to show first revision

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      JGitAPIImpl showRevision method running on first commit returns empty list.
      To show it I attach JUnitTest.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Thanks very much for including a unit test to illustrate the problem / question. Since the API you're testing is inside the git plugin, I changed the component from git-client to git. If the ultimate problem is in git-client, we can reassign it, and can write a test which does not require the GitChangeSet object.

          Show
          markewaite Mark Waite added a comment - Thanks very much for including a unit test to illustrate the problem / question. Since the API you're testing is inside the git plugin, I changed the component from git-client to git. If the ultimate problem is in git-client, we can reassign it, and can write a test which does not require the GitChangeSet object.
          Hide
          markewaite Mark Waite added a comment -

          The root problem appears to be in the JGit implementation of showRevision(null, Revision). It returns nothing when called with the first commit. I've added a test to the git-client-plugin to show the problem.

          Show
          markewaite Mark Waite added a comment - The root problem appears to be in the JGit implementation of showRevision(null, Revision). It returns nothing when called with the first commit. I've added a test to the git-client-plugin to show the problem.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Mark Waite
          Path:
          src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
          http://jenkins-ci.org/commit/git-client-plugin/76ca2ae64112fd34aa6fc99f32609b8041271504
          Log:
          Add test of JENKINS-22343 - JGit.showRevision is empty for first commit

          The failing test is marked with @NotImplementedInJGit. Those markers
          indicate gaps in the JGit implementation compared to the CliGit
          implementation.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/76ca2ae64112fd34aa6fc99f32609b8041271504 Log: Add test of JENKINS-22343 - JGit.showRevision is empty for first commit The failing test is marked with @NotImplementedInJGit. Those markers indicate gaps in the JGit implementation compared to the CliGit implementation.
          Hide
          markewaite Mark Waite added a comment -

          Fix implemented in JGit API implementation for git client plugin release after 1.8.1 (probably 1.9.0).

          Refer to the commit for details of the change.

          Show
          markewaite Mark Waite added a comment - Fix implemented in JGit API implementation for git client plugin release after 1.8.1 (probably 1.9.0). Refer to the commit for details of the change.
          Hide
          markewaite Mark Waite added a comment -

          Fixed in git-client-plugin 1.9.0

          Show
          markewaite Mark Waite added a comment - Fixed in git-client-plugin 1.9.0
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Mark Waite
          Path:
          src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java
          src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
          http://jenkins-ci.org/commit/git-client-plugin/ad1622ec78ce4efb0968d05ae7e687e67e0fd774
          Log:
          [Fix JENKINS-22343] JGit now shows first revision in repo correctly

          The first revision in the repository has no parent. The code assumed
          all commits have at least one parent.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/ad1622ec78ce4efb0968d05ae7e687e67e0fd774 Log: [Fix JENKINS-22343] JGit now shows first revision in repo correctly The first revision in the repository has no parent. The code assumed all commits have at least one parent.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              tigo Andrey Baidarov
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: