Search in sources :

Example 1 with GitMerger

use of git4idea.merge.GitMerger in project intellij-community by JetBrains.

the class GitMergeUpdater method doUpdate.

@Override
@NotNull
protected GitUpdateResult doUpdate() {
    LOG.info("doUpdate ");
    final GitMerger merger = new GitMerger(myProject);
    MergeLineListener mergeLineListener = new MergeLineListener();
    GitUntrackedFilesOverwrittenByOperationDetector untrackedFilesDetector = new GitUntrackedFilesOverwrittenByOperationDetector(myRoot);
    String originalText = myProgressIndicator.getText();
    myProgressIndicator.setText("Merging" + GitUtil.mention(myRepository) + "...");
    try {
        GitCommandResult result = myGit.merge(myRepository, assertNotNull(myTrackedBranches.get(myRoot).getDest()).getName(), asList("--no-stat", "-v"), mergeLineListener, untrackedFilesDetector, GitStandardProgressAnalyzer.createListener(myProgressIndicator));
        myProgressIndicator.setText(originalText);
        return result.success() ? GitUpdateResult.SUCCESS : handleMergeFailure(mergeLineListener, untrackedFilesDetector, merger, result.getErrorOutputAsJoinedString());
    } catch (ProcessCanceledException pce) {
        cancel();
        return GitUpdateResult.CANCEL;
    }
}
Also used : GitMerger(git4idea.merge.GitMerger) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) ObjectUtils.assertNotNull(com.intellij.util.ObjectUtils.assertNotNull) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ObjectUtils.assertNotNull (com.intellij.util.ObjectUtils.assertNotNull)1 GitMerger (git4idea.merge.GitMerger)1 NotNull (org.jetbrains.annotations.NotNull)1