Package org.eclipse.jgit.lib

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


    // make sure the config for target says we should pull with merge
    // we will override this later with the setRebase method
    StoredConfig targetConfig = dbTarget.getConfig();
    targetConfig.setBoolean("branch", "master", "rebase", false);
    targetConfig.save();

    // create commit in source
    writeToFile(sourceFile, SOURCE_FILE_CONTENTS);
    source.add().addFilepattern(sourceFile.getName()).call();
    source.commit().setMessage(SOURCE_COMMIT_MESSAGE).call();
View Full Code Here


        .addURI(new URIish(source.getRepository().getWorkTree()
            .getAbsolutePath()));
    config.addFetchRefSpec(new RefSpec(
        "+refs/heads/*:refs/remotes/origin/*"));
    config.update(targetConfig);
    targetConfig.save();

    targetFile = new File(dbTarget.getWorkTree(), "SomeFile.txt");
    // make sure we have the same content
    target.pull().call();
    target.checkout().setStartPoint("refs/remotes/origin/master").setName(
View Full Code Here

        "master").call();

    targetConfig
        .setString("branch", "master", "merge", "refs/heads/master");
    targetConfig.setBoolean("branch", "master", "rebase", true);
    targetConfig.save();

    assertFileContentsEqual(targetFile, "Hello world");
  }

  private static void writeToFile(File actFile, String string)
View Full Code Here

  public void testPullWithRebasePreserve1Config() throws Exception {
    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("pull", null, "rebase", "preserve");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE_PREASERVE);
  }
View Full Code Here

    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("pull", null, "rebase", "false");
        config.setString("branch", "master", "rebase", "preserve");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE_PREASERVE);
  }
View Full Code Here

  public void testPullWithRebasePreserveConfig3() throws Exception {
    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("branch", "master", "rebase", "preserve");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE_PREASERVE);
  }
View Full Code Here

  public void testPullWithRebaseConfig1() throws Exception {
    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("pull", null, "rebase", "true");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE);
  }
View Full Code Here

    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("pull", null, "rebase", "preserve");
        config.setString("branch", "master", "rebase", "true");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE);
  }
View Full Code Here

  public void testPullWithRebaseConfig3() throws Exception {
    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("branch", "master", "rebase", "true");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.REBASE);
  }
View Full Code Here

    Callable<PullResult> setup = new Callable<PullResult>() {
      public PullResult call() throws Exception {
        StoredConfig config = dbTarget.getConfig();
        config.setString("pull", null, "rebase", "true");
        config.setString("branch", "master", "rebase", "false");
        config.save();
        return target.pull().call();
      }
    };
    doTestPullWithRebase(setup, TestPullMode.MERGE);
  }
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.