Package org.eclipse.jgit.transport

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


    // setup the first repository to fetch from the second repository
    final StoredConfig config = db.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "test");
    URIish uri = new URIish(remoteRepository.getDirectory().toURI().toURL());
    remoteConfig.addURI(uri);
    remoteConfig.update(config);
    config.save();

    remoteGit.commit().setMessage("initial commit").call();
    remoteGit.tag().setName("tag").call();
    remoteGit.checkout().setName("other").setCreateBranch(true).call();
View Full Code Here


        rc.addPushURI(new URIish(remotePushURI));
      // PushRefSpec is optional
      if (pushRefSpec != null && !pushRefSpec.isEmpty())
        rc.addPushRefSpec(new RefSpec(pushRefSpec));

      rc.update(config);
      config.save();

      Remote remote = new Remote(cloneLocation, db, remoteName);
      JSONObject result = new JSONObject();
      result.put(ProtocolConstants.KEY_LOCATION, remote.getLocation());
View Full Code Here

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

  private FetchResult runFetch() throws NotSupportedException,
      URISyntaxException, TransportException {
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 = 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

    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

    remoteConfig.addURI(uri);
    RefSpec defaultFetchSpec = new RefSpec().setForceUpdate(true)
        .setSourceDestination(Constants.R_HEADS + "*", //$NON-NLS-1$
            Constants.R_REMOTES + remoteName + "/*"); //$NON-NLS-1$
    remoteConfig.addFetchRefSpec(defaultFetchSpec);
    remoteConfig.update(config);
    config.save();
  }

  private void configureUpstream() throws IOException {
    if (this.ref == null) {
View Full Code Here

          repository.getConfig(), remoteName);
      if (pushRefSpec != null)
        configToUse.addPushRefSpec(new RefSpec(pushRefSpec));
      if (pushURI != null)
        configToUse.addPushURI(pushURI);
      configToUse.update(repository.getConfig());
      repository.getConfig().save();
    } catch (Exception e) {
      throw new CoreException(Activator.error(e.getMessage(), e));
    }
View Full Code Here

  private void saveRefSpecs() {
    final RemoteConfig rc = repoPage.getSelection().getConfig();
    rc.setPushRefSpecs(refSpecPage.getRefSpecs());
    final StoredConfig config = localDb.getConfig();
    rc.update(config);
    try {
      config.save();
    } catch (final IOException e) {
      ErrorDialog.openError(getShell(), UIText.PushWizard_cantSaveTitle,
          UIText.PushWizard_cantSaveMessage, new Status(
View Full Code Here

    try {
      RemoteConfig configToUse = new RemoteConfig(
          repository.getConfig(), remoteName);
      if (fetchRefSpec != null)
        configToUse.addFetchRefSpec(new RefSpec(fetchRefSpec));
      configToUse.update(repository.getConfig());
      repository.getConfig().save();
      Git git = new Git(repository);
      try {
        git.fetch().setRemote(remoteName).call();
      } catch (Exception e) {
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.