private static @NotNull List<@NlsSafe String> collectErrorOutputLines(@NotNull GitCommandResult result) {
    List<String> errors = new ArrayList<>();
    errors.addAll(ContainerUtil.filter(result.getOutput(), line -> GitHandlerUtil.isErrorLine(line.trim())));
    errors.addAll(ContainerUtil.filter(result.getErrorOutput(), line -> GitHandlerUtil.isErrorLine(line.trim())));

    if (errors.isEmpty() && !result.success()) {
      errors.addAll(result.getErrorOutput());
      if (errors.isEmpty()) {
        List<String> output = result.getOutput();
        String lastOutput = ContainerUtil.findLast(output, line -> !StringUtil.isEmptyOrSpaces(line));
        return Collections.singletonList(lastOutput);
      }
    }
    return errors;
  }
private static @NotNull List<@NlsSafe String> collectErrorOutputLines(@NotNull GitCommandResult result)