Search in sources :

Example 1 with GitExecutionException

use of git4idea.GitExecutionException in project intellij-community by JetBrains.

the class GitBranchWorker method loadCommitsToCompare.

@NotNull
private Couple<List<GitCommit>> loadCommitsToCompare(@NotNull GitRepository repository, @NotNull final String branchName) {
    final List<GitCommit> headToBranch;
    final List<GitCommit> branchToHead;
    try {
        headToBranch = GitHistoryUtils.history(myProject, repository.getRoot(), ".." + branchName);
        branchToHead = GitHistoryUtils.history(myProject, repository.getRoot(), branchName + "..");
    } catch (VcsException e) {
        // we treat it as critical and report an error
        throw new GitExecutionException("Couldn't get [git log .." + branchName + "] on repository [" + repository.getRoot() + "]", e);
    }
    return Couple.of(headToBranch, branchToHead);
}
Also used : GitCommit(git4idea.GitCommit) GitExecutionException(git4idea.GitExecutionException) VcsException(com.intellij.openapi.vcs.VcsException) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

VcsException (com.intellij.openapi.vcs.VcsException)1 GitCommit (git4idea.GitCommit)1 GitExecutionException (git4idea.GitExecutionException)1 NotNull (org.jetbrains.annotations.NotNull)1