-
Bug
-
Resolution: Fixed
-
Major
-
None
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; }