Examples of addFetchRefSpec()


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

    final StoredConfig config = db.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, remote);
    URIish uri = new URIish(db2.getDirectory().toURI().toURL());
    remoteConfig.addURI(uri);
    remoteConfig.addFetchRefSpec(new RefSpec("+refs/heads/*:refs/remotes/"
        + remote + "/*"));
    remoteConfig.update(config);
    config.save();


 
View Full Code Here

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

    final StoredConfig config = git.getRepository().getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "test");
    URIish uri = new URIish(git2.getRepository().getDirectory().toURI()
        .toURL());
    remoteConfig.addURI(uri);
    remoteConfig.addFetchRefSpec(new RefSpec(
        "+refs/heads/*:refs/remotes/origin/*"));
    remoteConfig.update(config);
    config.save();

    writeTrashFile("f", "content of f");
View Full Code Here

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

  private void saveRemote(final URIish uri) throws URISyntaxException,
      IOException {
    final StoredConfig dstcfg = dst.getConfig();
    final RemoteConfig rc = new RemoteConfig(dstcfg, remoteName);
    rc.addURI(uri);
    rc.addFetchRefSpec(new RefSpec().setForceUpdate(true)
        .setSourceDestination(Constants.R_HEADS + "*", //$NON-NLS-1$
            Constants.R_REMOTES + remoteName + "/*")); //$NON-NLS-1$
    rc.update(dstcfg);
    dstcfg.save();
  }
View Full Code Here

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

      // FetchRefSpec is required, but default version can be generated
      // if it isn't provided
      if (fetchRefSpec == null || fetchRefSpec.isEmpty()) {
        fetchRefSpec = String.format("+refs/heads/*:refs/remotes/%s/*", remoteName); //$NON-NLS-1$
      }
      rc.addFetchRefSpec(new RefSpec(fetchRefSpec));
      // pushURI is optional
      if (remotePushURI != null && !remotePushURI.isEmpty())
        rc.addPushURI(new URIish(remotePushURI));
      // PushRefSpec is optional
      if (pushRefSpec != null && !pushRefSpec.isEmpty())
View Full Code Here

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

  private void saveRemote(final URIish uri) throws URISyntaxException,
      IOException {
    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();
  }
 
View Full Code Here

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

        + config.getName();
    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
View Full Code Here

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

        + config.getName() + "/") + "*"; //$NON-NLS-1$//$NON-NLS-2$
    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
View Full Code Here

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

        + config.getName();
    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
View Full Code Here

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

    RemoteConfig remoteConfig = new RemoteConfig(config, remoteName);
    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 {
View Full Code Here

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

      throws CoreException {
    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();
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.