Issue Type: Bug Bug
Affects Versions: current
Assignee: Nicolas De Loof
Components: git
Created: 18/Jul/12 10:57 AM
Description:

If a branch to build is specified like REPONAME/BRANCHNAME then the git plugin will look for branches named REPONAME/REPONAME/BRANCHNAME.
Worse still, if the git repository has multiple repositories configured, it will then search for OTHERREPO/REPONAME/REPONAME/BRANCHNAME.

I believe this is the same cause as https://issues.jenkins-ci.org/browse/JENKINS-14394

I believe the problem code to be https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java#L73, the block after 'if (!singleBranch.contains("/"))' should be inside it, since that is for unqialified branches.

I worked around this issue by changing the refspecs to include an extra component in the branch, so origin/master becomes origin/UGLYHACK/master with +refs/heads/:+refs/remotes/origin/UGLYHACK/, so the branch specification becomes origin/*/master.

Environment: Debian Squeeze on x86_64
Project: Jenkins
Priority: Major Major
Reporter: Richard Maw
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to