Skip to content

Commit

Permalink
Fixed ambiguous ls-remote with refs/heads/...
Browse files Browse the repository at this point in the history
This is the smallest possible change to solve the
issue of CI builds being triggered again and again.
ls-remote will always be definite when "refs/heads/<branchName>"
is used as branchSpec.

All other issues tried to solve with Pull Request
#129
are still open. But using refs/heads/ would already solve
the CI issue.
  • Loading branch information
alxsap authored and MarkEWaite committed Jul 19, 2014
1 parent 4a3586f commit bb72363
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -1857,8 +1857,8 @@ public Map<String, ObjectId> getHeadRev(String url) throws GitException, Interru
}

public ObjectId getHeadRev(String url, String branchSpec) throws GitException, InterruptedException {
final String branchName = normalizeBranchSpec(branchSpec);

final String branchName = (branchSpec.startsWith("refs/heads/"))
? branchSpec :extractBranchNameFromBranchSpec(branchSpec);
ArgumentListBuilder args = new ArgumentListBuilder("ls-remote");
if(!branchName.startsWith("refs/tags/")) {
args.add("-h");
Expand Down

0 comments on commit bb72363

Please sign in to comment.