Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.RemoteConfig.update()


  private void saveConfig() {
    final RemoteConfig rc = repoPage.getSelection().getConfig();
    rc.setFetchRefSpecs(refSpecPage.getRefSpecs());
    rc.setTagOpt(refSpecPage.getTagOpt());
    final StoredConfig config = localDb.getConfig();
    rc.update(config);
    try {
      config.save();
    } catch (final IOException e) {
      ErrorDialog.openError(getShell(), UIText.FetchWizard_cantSaveTitle,
          UIText.FetchWizard_cantSaveMessage, new Status(
View Full Code Here


  public void shouldReturnDstMergeForRemoteBranch() throws Exception {
    // given
    StoredConfig config = repo.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "origin");
    remoteConfig.setFetchRefSpecs(Arrays.asList(new RefSpec("+refs/heads/*:refs/remotes/origin/*")));
    remoteConfig.update(config);

    GitSynchronizeData gsd = new GitSynchronizeData(repo, HEAD,
        "refs/remotes/origin/master", false);

    assertThat(gsd.getDstRemoteName(), is("origin"));
View Full Code Here

    Repository repository = lookupRepository(repositoryFile);
    StoredConfig config = repository.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "origin");
    remoteConfig.addURI(new URIish(childRepository.getDirectory().getParentFile().toURI().toURL()));
    remoteConfig.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/origin/*"));
    remoteConfig.update(config);

    config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants.CONFIG_KEY_REMOTE, "origin");
    config.setString(ConfigConstants.CONFIG_BRANCH_SECTION, "master", ConfigConstants.CONFIG_KEY_MERGE, "refs/heads/master");
    config.save();

View Full Code Here

    RefSpec refSpec = new RefSpec();
    refSpec = refSpec.setForceUpdate(true);
    refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$

    config.addFetchRefSpec(refSpec);
    config.update(clonedRepo.getConfig());

    clonedRepo.getConfig().save();

    // run the fetch command
    FetchCommand command = new FetchCommand(clonedRepo);
View Full Code Here

    refSpec = refSpec.setForceUpdate(true);
    refSpec = refSpec.setSourceDestination(
        Constants.R_HEADS + "*", dst + "/*"); //$NON-NLS-1$ //$NON-NLS-2$

    config.addFetchRefSpec(refSpec);
    config.update(clonedRepo.getConfig());

    clonedRepo.getConfig().save();

    // run the fetch command
    FetchCommand command = new FetchCommand(clonedRepo);
View Full Code Here

    RefSpec refSpec = new RefSpec();
    refSpec = refSpec.setForceUpdate(true);
    refSpec = refSpec.setSourceDestination(Constants.R_HEADS + "*", dst); //$NON-NLS-1$

    config.addFetchRefSpec(refSpec);
    config.update(clonedRepo.getConfig());

    clonedRepo.getConfig().save();

    // run the fetch command
    FetchCommand command = new FetchCommand(clonedRepo);
View Full Code Here

        // save remote
        final RemoteConfig rc = new RemoteConfig(repo.getConfig(), "origin");
        rc.addURI(uri);
        rc.addFetchRefSpec(new RefSpec().setForceUpdate(true).setSourceDestination(Constants.R_HEADS + "*",
                Constants.R_REMOTES + "origin" + "/*"));
        rc.update(repo.getConfig());
        repo.getConfig().save();
    }

    public static FetchResult doFetch(Repository repo, OutputLogger logger) throws NotSupportedException, TransportException, URISyntaxException {
        final FetchResult r;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.