Ejemplo n.º 1
0
  @NotNull
  private GitFetchResult fetchCurrentRemote(@NotNull GitRepository repository) {
    FetchParams fetchParams = getFetchParams(repository);
    if (fetchParams.isError()) {
      return fetchParams.getError();
    }

    GitRemote remote = fetchParams.getRemote();
    String url = fetchParams.getUrl();
    return fetchRemote(repository, remote, url);
  }
Ejemplo n.º 2
0
  // leaving this unused method, because the wanted behavior can change again
  @SuppressWarnings("UnusedDeclaration")
  @NotNull
  private GitFetchResult fetchCurrentBranch(@NotNull GitRepository repository) {
    FetchParams fetchParams = getFetchParams(repository);
    if (fetchParams.isError()) {
      return fetchParams.getError();
    }

    GitRemote remote = fetchParams.getRemote();
    String remoteBranch = fetchParams.getRemoteBranch().getNameForRemoteOperations();
    String url = fetchParams.getUrl();
    if (GitHttpAdapter.shouldUseJGit(url)) {
      return GitHttpAdapter.fetch(repository, remote, url, remoteBranch);
    }
    return fetchNatively(repository.getRoot(), remote, remoteBranch);
  }