Fix HTTP 404 error for the rebuild open MRs on push to target branch for forked repositories

This commit is contained in:
Robin Müller 2016-05-04 23:15:30 +02:00
parent 9656e73906
commit fcde6857ea
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class OpenMergeRequestPushHookTriggerHandler implements PushHookTriggerHandler {
LOGGER.log(Level.INFO, "{0} triggered for push to target branch of open merge request #{1}.",
LoggerUtil.toArray(job.getFullName(), mergeRequest.getId()));
Branch branch = client.getBranch(projectId.toString(), sourceBranch);
Branch branch = client.getBranch(mergeRequest.getSourceProjectId().toString(), sourceBranch);
Project project = client.getProject(mergeRequest.getSourceProjectId().toString());
scheduleBuild(job, new CauseAction(new GitLabWebHookCause(retrieveCauseData(hook, project, mergeRequest, branch))));
}