Commit 748f7d4e authored by Brice Jaglin's avatar Brice Jaglin

support merge requests from a different project (fork) in getCommits()

parent 7c751341
......@@ -154,7 +154,11 @@ public class GitlabAPI {
}
public List<GitlabCommit> getCommits(GitlabMergeRequest mergeRequest) throws IOException {
String tailUrl = GitlabProject.URL + "/" + mergeRequest.getProjectId() +
Integer projectId = mergeRequest.getSourceProjectId();
if (projectId == null) {
projectId = mergeRequest.getProjectId();
}
String tailUrl = GitlabProject.URL + "/" + projectId +
"/repository" + GitlabCommit.URL + "?ref_name=" + mergeRequest.getSourceBranch();
GitlabCommit[] commits = retrieve().to(tailUrl, GitlabCommit[].class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment