Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: git, git-client
Created: 02/Jun/14 7:13 AM
Description:

Reproduction scenrario:
create 2 remote branches in "origin"
1) 1 - called bug/namespace/master
2) 2 - called namespace/master

Setup the projec to poll scm (every minute) and to build the branch namespace/master.
Expected result: if there are no changes in namespace/master it wont get rebuilt.
Actual: branch is constantly rebuilt

the problem is in git-client since the command
git ls-remote <uri> namespace/master will return you both branch revisions and take the first one ..
buggy method is :

CliGitAPIImpl:

public ObjectId getHeadRev(String url, String branchSpec) throws GitException, InterruptedException { final String branchName = extractBranchNameFromBranchSpec(branchSpec); ArgumentListBuilder args = new ArgumentListBuilder("ls-remote"); args.add("-h"); StandardCredentials cred = credentials.get(url); if (cred == null) cred = defaultCredentials; args.add(url); args.add(branchName); String result = launchCommandWithCredentials(args, null, cred, url); return result.length()>=40 ? ObjectId.fromString(result.substring(0, 40)) : null; }

Project: Jenkins
Priority: Major Major
Reporter: sashas83
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

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to