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

GitSCM checks wrong branch for changes

    Details

    • Similar Issues:

      Description

      Steps:
      1. Setup a repo with such branches:
      A/SameNameBranch
      B/SameNameBranch

      2. Setup job to poll "B/SameNameBranch"
      3. Watch never ending changes

      Expected:
      plugin executes this command on getting current commit hash:
      git ls-remote -h git@repo.org:user/some.git B/SameNameBranch

      Actual:
      plugin executes WRONG command on getting current commit hash:
      git ls-remote -h git@repo.org:user/some.git SameNameBranch

      It skips full branch name and only uses last path component. This command then returns list of all branches ending with "SameNameBranch", and "A" version has different commit than the needed one. Please just make it to call command with full branch name

        Attachments

          Activity

          Show
          redf Artem Alexandrov added a comment - https://issues.jenkins-ci.org/browse/JENKINS-23266
          Hide
          markewaite Mark Waite added a comment -

          Alexander Link's changes which were included in git client plugin 1.10.1 provide a solution for this bug report. Refer to the "Branches to build" online help for the description of the various options for the refs/ syntax to construct precise branch names.

          This can also probably be solved by placing a ":" as the first character of the string in "Branches to build", then follow the colon with a regular expression which matches the desired branch. The regular expression syntax has been in the plugin for quite a while, but it is not mentioned in the online help.

          A future version of the git plugin will mention it in the online help.

          Show
          markewaite Mark Waite added a comment - Alexander Link's changes which were included in git client plugin 1.10.1 provide a solution for this bug report. Refer to the "Branches to build" online help for the description of the various options for the refs/ syntax to construct precise branch names. This can also probably be solved by placing a ":" as the first character of the string in "Branches to build", then follow the colon with a regular expression which matches the desired branch. The regular expression syntax has been in the plugin for quite a while, but it is not mentioned in the online help. A future version of the git plugin will mention it in the online help.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              redf Artem Alexandrov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: