GitCommandResult (final @NotNull GitRepository repository, final @NotNull GitRemote remote, final @NotNull List<? extends GitLineHandlerListener> listeners, @Nullable AuthenticationGate authenticationGate, final String... params) { return runCommand(() -> { GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.FETCH); if (authenticationGate != null) { h.setAuthenticationGate(authenticationGate); } h.setSilent(false); h.setStdoutSuppressed(false); h.setUrls(remote.getUrls()); h.addParameters(remote.getName()); h.addParameters(params); if(GitVersionSpecialty.ABLE_TO_USE_PROGRESS_IN_REMOTE_COMMANDS.existsIn(repository)) { h.addParameters("--progress"); } if (GitVersionSpecialty.SUPPORTS_FETCH_PRUNE.existsIn(repository)) { h.addParameters("--prune"); } addListeners(h, listeners); return h; }); }