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

CliGitAPIImpl.getRemoteReferences throws exception when there are no tags

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.609.2
      Job DSL 1.37
    • Similar Issues:

      Description

      GitClient.getRemoteReferences javadoc says that it should return empty map if no references were found.
      Instead of that it throws the following exception:

      hudson.plugins.git.GitException: unexpected ls-remote output
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getRemoteReferences(CliGitAPIImpl.java:2391)

      my method invocation looks like that:
      gitClient.getRemoteReferences(gitUrl, "*", false, true)

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          Are you sure that you selected the correct component? Why is this a Job DSL Plugin issue?

          Show
          daspilker Daniel Spilker added a comment - Are you sure that you selected the correct component? Why is this a Job DSL Plugin issue?
          Hide
          tulinski Tomasz Ulinski added a comment -

          Daniel, of course I choose an inappropriate component. I've changed it already.

          Show
          tulinski Tomasz Ulinski added a comment - Daniel, of course I choose an inappropriate component. I've changed it already.
          Hide
          markewaite Mark Waite added a comment -

          Submitted PR286 with a test to confirm that CliGitAPIImpl was behaving differently than JGitAPIImpl, and to then make the CliGitAPIImpl behavior consistent with the javadoc and with JGitAPIImpl.

          Show
          markewaite Mark Waite added a comment - Submitted PR286 with a test to confirm that CliGitAPIImpl was behaving differently than JGitAPIImpl, and to then make the CliGitAPIImpl behavior consistent with the javadoc and with JGitAPIImpl.
          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/GitClientTest.java
          http://jenkins-ci.org/commit/git-client-plugin/a59623c984b88e1847b75202c42730e68d43bc7f
          Log:
          Add test for JENKINS-30589 - getRemoteReferences return empty map

          JGit correctly returns an empty map when remote references are not
          found, while CliGitAPIImpl threw an exception.

          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/GitClientTest.java http://jenkins-ci.org/commit/git-client-plugin/a59623c984b88e1847b75202c42730e68d43bc7f Log: Add test for JENKINS-30589 - getRemoteReferences return empty map JGit correctly returns an empty map when remote references are not found, while CliGitAPIImpl threw an exception.
          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/CliGitAPIImpl.java
          http://jenkins-ci.org/commit/git-client-plugin/1e1f8ff83c87208e009788502f805d368e0e75fa
          Log:
          [Fix JENKINS-30589] - getRemoteReferences return empty map

          JGit correctly returns an empty map when remote references are not
          found, while CliGitAPIImpl threw an exception, now returns empty map.

          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/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/1e1f8ff83c87208e009788502f805d368e0e75fa Log: [Fix JENKINS-30589] - getRemoteReferences return empty map JGit correctly returns an empty map when remote references are not found, while CliGitAPIImpl threw an exception, now returns empty map.
          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/CliGitAPIImpl.java
          src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java
          http://jenkins-ci.org/commit/git-client-plugin/c2b1ff48f3a3ec060e47787b25ba0e10a84b1cfa
          Log:
          Merge pull request #286 from MarkEWaite/getRemoteReferences-enpty-return-exception

          JENKINS-30589 Get remote references consistent return in all implementations

          Compare: https://github.com/jenkinsci/git-client-plugin/compare/1800763b1dc0...c2b1ff48f3a3

          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/CliGitAPIImpl.java src/test/java/org/jenkinsci/plugins/gitclient/GitClientTest.java http://jenkins-ci.org/commit/git-client-plugin/c2b1ff48f3a3ec060e47787b25ba0e10a84b1cfa Log: Merge pull request #286 from MarkEWaite/getRemoteReferences-enpty-return-exception JENKINS-30589 Get remote references consistent return in all implementations Compare: https://github.com/jenkinsci/git-client-plugin/compare/1800763b1dc0...c2b1ff48f3a3
          Hide
          markewaite Mark Waite added a comment - - edited

          Fixed in the git client plugin 2.7.0

          Show
          markewaite Mark Waite added a comment - - edited Fixed in the git client plugin 2.7.0

            People

            • Assignee:
              markewaite Mark Waite
              Reporter:
              tulinski Tomasz Ulinski
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: