Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.StoredConfig.save()


    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();


    RevCommit commit2 = git.commit().setMessage("Commit to push").call();

    RefSpec spec = new RefSpec(branch + ":" + branch);
View Full Code Here


    URIish uri = new URIish(git2.getRepository().getDirectory().toURI()
        .toURL());
    remoteConfig.addURI(uri);
    remoteConfig.addPushRefSpec(new RefSpec("+refs/heads/*:refs/heads/*"));
    remoteConfig.update(config);
    config.save();

    writeTrashFile("f", "content of f");
    git.add().addFilepattern("f").call();
    RevCommit commit = git.commit().setMessage("adding f").call();

View Full Code Here

    URIish uri = new URIish(git2.getRepository().getDirectory().toURI()
        .toURL());
    remoteConfig.addURI(uri);
    remoteConfig.addPushRefSpec(new RefSpec("HEAD:refs/heads/newbranch"));
    remoteConfig.update(config);
    config.save();

    writeTrashFile("f", "content of f");
    git.add().addFilepattern("f").call();
    RevCommit commit = git.commit().setMessage("adding f").call();
View Full Code Here

        .toURL());
    remoteConfig.addURI(uri);
    remoteConfig.addFetchRefSpec(new RefSpec(
        "+refs/heads/*:refs/remotes/origin/*"));
    remoteConfig.update(config);
    config.save();

    writeTrashFile("f", "content of f");
    git.add().addFilepattern("f").call();
    RevCommit commit = git.commit().setMessage("adding f").call();

View Full Code Here

    final StoredConfig config = db.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "test");
    URIish uri = new URIish(db2.getDirectory().toURI().toURL());
    remoteConfig.addURI(uri);
    remoteConfig.update(config);
    config.save();

    Git git1 = new Git(db);
    Git git2 = new Git(db2);

    // push master (with a new commit) to the remote
View Full Code Here

            // remove upstream configuration if any
            final StoredConfig cfg = repo.getConfig();
            cfg.unsetSection(
                ConfigConstants.CONFIG_BRANCH_SECTION,
                shortenedName);
            cfg.save();
          }
        } else
          throw new JGitInternalException(MessageFormat.format(
              JGitText.get().deleteBranchUnexpectedResult,
              deleteResult.name()));
View Full Code Here

    dst = new FileRepositoryBuilder().setGitDir(new File(gitdir)).build();
    dst.create();
    final StoredConfig dstcfg = dst.getConfig();
    dstcfg.setBoolean("core", null, "bare", false); //$NON-NLS-1$ //$NON-NLS-2$
    dstcfg.save();
    db = dst;

    outw.print(MessageFormat.format(
        CLIText.get().initializedEmptyGitRepositoryIn, gitdir));
    outw.println();
View Full Code Here

    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();
  }

  private FetchResult runFetch() throws URISyntaxException, IOException {
    final Transport tn = Transport.open(db, remoteName);
    final FetchResult r;
View Full Code Here

    final StoredConfig config = db2.getConfig();
    RemoteConfig remoteConfig = new RemoteConfig(config, "origin");
    URIish uri = new URIish(db.getDirectory().toURI().toURL());
    remoteConfig.addURI(uri);
    remoteConfig.update(config);
    config.save();

    // fetch from first repository
    RefSpec spec = new RefSpec("+refs/heads/*:refs/remotes/origin/*");
    git2.fetch().setRemote("origin").setRefSpecs(spec).call();
    return db2;
View Full Code Here

  @Test
  public void renameBranchNoConfigValues() throws Exception {
    StoredConfig config = git.getRepository().getConfig();
    config.unsetSection(ConfigConstants.CONFIG_BRANCH_SECTION,
        Constants.MASTER);
    config.save();

    String branch = "b1";
    assertTrue(config.getNames(ConfigConstants.CONFIG_BRANCH_SECTION,
        Constants.MASTER).isEmpty());
    assertNotNull(git.branchRename().setNewName(branch).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.