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

Jenkins builds incorrect branch when regex branch specifier changes

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • git-plugin 2.4.0
      Jenkins ver. 1.626

      Today I noticed what seems to be a bug in Jenkins/git-plugin due to some sort of caching(??)

      • create new freestyle project
      • use git scm
      • specify a regex branch specifier, eg. :origin/master
      • save and build
      • update project, changing the branch specifier, eg. :origin/yolo
      • save and build
      • update the project, changing the branch specifier back to the original, eg. :origin/master
      • save and build

      I'd expect the last build to be master, but it really just checks out the previous branch :origin/yolo.

      I came across this when I tried using a parameterized build setup to build multiple branches :origin/(master|v.*) on scm change, with the option to manually specify a branch to build via the parameter. However, after changing the branch specifier in this case, Jenkins/git-plugin seems to get stuck on one branch :o.

      Let me know if I can help with any other details.

          [JENKINS-31865] Jenkins builds incorrect branch when regex branch specifier changes

          William Hutson created issue -
          William Hutson made changes -
          Environment Original: Jenkins ver. 1.626
          New: git-plugin 2.4.0
          Jenkins ver. 1.626
          William Hutson made changes -
          Description New: Today I noticed what seems to be a bug in Jenkins/git-plugin due to some sort of caching(??)

          - create new freestyle project
          - use git scm
          - specify a regex branch specifier, eg. :origin/master
          - save and build
          - update project, changing the branch specifier, eg. :origin/yolo
          - save and build
          - update the project, changing the branch specifier back to the original, eg. :origin/master
          - save and build

          I'd expect the last build to be master, but it really just checks out the previous branch :origin/yolo.

          I came across this when I tried using a parameterized build setup to build multiple branches :origin/(master|v.*) on scm change, with the option to manually specify a branch to build via the parameter. However, after changing the branch specifier in this case, Jenkins/git-plugin seems to get stuck on one branch :o.

          Let me know if I can help with any other details.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 167328 ] New: JNJira + In-Review [ 182685 ]

            Unassigned Unassigned
            wilrnh William Hutson
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: