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

Endless builds with local branch checked out

XMLWordPrintable

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

      When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:

      Multiple candidate revisions
      Scheduling another build to catch up with <build name>

      This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

      A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:

      Multiple candidate revisions
      Scheduling another build to catch up with <build name>
      Checking out Revision <revision> (<local branch name>)
      > git config core.sparsecheckout # timeout=10
      > git checkout -f <revision>
      > git branch -a -v --no-abbrev # timeout=10
      > git branch -D <local branch name> # timeout=10
      > git checkout -b <local branch name> <revision>

      ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.

       

            Unassigned Unassigned
            jobh Joachim Haga
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: