if (ref != null)
merge.include(ref);
else
merge.include(ObjectId.fromString(refName));
} catch (IOException e) {
throw new TeamException(CoreText.MergeOperation_InternalError, e);
}
if (fastForwardMode != null)
merge.setFastForward(fastForwardMode);
if (commit != null)
merge.setCommit(commit.booleanValue());
if (squash != null)
merge.setSquash(squash.booleanValue());
if (mergeStrategy != null) {
merge.setStrategy(mergeStrategy);
}
if (message != null)
merge.setMessage(message);
try {
mergeResult = merge.call();
mymonitor.worked(1);
if (MergeResult.MergeStatus.NOT_SUPPORTED.equals(mergeResult.getMergeStatus()))
throw new TeamException(new Status(IStatus.INFO, Activator.getPluginId(), mergeResult.toString()));
} catch (NoHeadException e) {
throw new TeamException(CoreText.MergeOperation_MergeFailedNoHead, e);
} catch (ConcurrentRefUpdateException e) {
throw new TeamException(CoreText.MergeOperation_MergeFailedRefUpdate, e);
} catch (CheckoutConflictException e) {
mergeResult = new MergeResult(e.getConflictingPaths());
return;
} catch (GitAPIException e) {
throw new TeamException(e.getLocalizedMessage(), e.getCause());
} finally {
ProjectUtil.refreshValidProjects(validProjects, new SubProgressMonitor(
mymonitor, 1));
mymonitor.done();
}