• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      When creating and pushing a tag with the Git Publisher, it gets pushed to the remote repository as a branch. The console output shows:

      Pushing tag 4.6.44.0.5 to repo XXX
      RefSpec is "refs/tags/4.6.44.0.5:refs/heads/4.6.44.0.5".
      

      This appears to be caused by a combination of:

      • Line 272 in hudson.plugins.git.GitPublisher (in git-plugin)
        • PushCommand push = git.push().to(remoteURI).ref(tagName);
          
      • The call to fixRefSpec() in org.jenkinsci.plugins.gitclient.JGitAPIImpl
        • This class is in git-client-plugin
        • Without a full reference passed to PushCommand.ref(), it defaults to prepending the name with "/refs/heads".
        • It should probably default to the prefix used in the source ref rather than "heads"

      I don't know if the bug/fix is in git-plugin or git-client-plugin - probably the latter because the CLI client may work fine.

          [JENKINS-56205] Git Publisher Pushes Tags as Branches (JGit)

          Donal O'Brien created issue -
          Donal O'Brien made changes -
          Description Original: When creating and pushing a tag with the Git Publisher, it gets pushed to the remote repository as a branch. The console output shows:
          {noformat}
          Pushing tag 4.6.44.0.5 to repo XXX
          RefSpec is "refs/tags/4.6.44.0.5:refs/heads/4.6.44.0.5".
          {noformat}
          This appears to be caused by a combination of:
           * Line 272 in hudson.plugins.git.GitPublisher
           **
          {code:java}
          PushCommand push = git.push().to(remoteURI).ref(tagName);
          {code}

           * The call to fixRefSpec() in org.jenkinsci.plugins.gitclient.JGitAPIImpl
           ** This class is in git-client-plugin
           ** Without a full reference passed to PushCommand.ref(), it defaults to prepending the name with "/refs/heads".
           ** It should probably default to the prefix used in the source ref rather than "heads"

          I don't know if the bug/fix is in git-plugin or git-client-plugin - probably the latter because the CLI client may work fine.
          New: When creating and pushing a tag with the Git Publisher, it gets pushed to the remote repository as a branch. The console output shows:
          {noformat}
          Pushing tag 4.6.44.0.5 to repo XXX
          RefSpec is "refs/tags/4.6.44.0.5:refs/heads/4.6.44.0.5".
          {noformat}
          This appears to be caused by a combination of:
           * Line 272 in hudson.plugins.git.GitPublisher (in git-plugin)
           **
          {code:java}
          PushCommand push = git.push().to(remoteURI).ref(tagName);
          {code}

           * The call to fixRefSpec() in org.jenkinsci.plugins.gitclient.JGitAPIImpl
           ** This class is in git-client-plugin
           ** Without a full reference passed to PushCommand.ref(), it defaults to prepending the name with "/refs/heads".
           ** It should probably default to the prefix used in the source ref rather than "heads"

          I don't know if the bug/fix is in git-plugin or git-client-plugin - probably the latter because the CLI client may work fine.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s Original: git-client-plugin [ 17423 ]

            Unassigned Unassigned
            donalob Donal O'Brien
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: