Eclipseplugins
CherryPickOperation.java
1 package com.proalpha.pds.gitutils.cherrypick;
2 
3 import org.eclipse.core.runtime.jobs.ISchedulingRule;
4 import org.eclipse.egit.core.internal.job.RuleUtil;
5 import org.eclipse.jgit.api.errors.GitAPIException;
6 
7 import com.proalpha.git.commands.PaIssueConveyanceCommand;
8 import com.proalpha.git.model.PaCherryPickResult;
9 
10 public class CherryPickOperation {
11 
12  private PaIssueConveyanceCommand cherryPickCommand;
13  private PaCherryPickResult cherryPickResult;
14 
15  public CherryPickOperation(PaIssueConveyanceCommand cherryPickCommand) {
16  this.cherryPickCommand = cherryPickCommand;
17  }
18 
19  public void execute() throws GitAPIException {
20  cherryPickResult = cherryPickCommand.call();
21  }
22 
23  public PaCherryPickResult getOperationResult() {
24  return cherryPickResult;
25  }
26 
27  @SuppressWarnings("restriction")
28  public ISchedulingRule getSchedulingRule() {
29  if (cherryPickCommand != null)
30  return RuleUtil.getRule(cherryPickCommand.getRepository());
31  else
32  return null;
33  }
34 }