Package org.eclipse.jgit.junit

Examples of org.eclipse.jgit.junit.TestRepository.commit()


    }

    // Now put private stuff into dst.
    //
    b = d.blob("b");
    P = d.commit(d.tree(d.file("b", b)), A);
    d.update(R_PRIVATE, P);
  }

  @Override
  protected void tearDown() throws Exception {
View Full Code Here


    assertFalse("b not loose", od.fileFor(b).exists());

    // Now use b but in a different commit than what is hidden.
    //
    TestRepository s = new TestRepository(src);
    RevCommit N = s.commit().parent(B).add("q", b).create();
    s.update(R_MASTER, N);

    // Push this new content to the remote, doing strict validation.
    //
    TransportLocal t = new TransportLocal(src, uriOf(dst)) {
View Full Code Here

  }

  public void testPush_CreateBranch() throws Exception {
    final TestRepository src = createTestRepository();
    final RevBlob Q_txt = src.blob("new text");
    final RevCommit Q = src.commit().add("Q", Q_txt).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    final Transport t = Transport.open(db, remoteURI);
    try {
      final String srcExpr = Q.name();
View Full Code Here

  }

  public void testPush_NotAuthorized() throws Exception {
    final TestRepository src = createTestRepository();
    final RevBlob Q_txt = src.blob("new text");
    final RevCommit Q = src.commit().add("Q", Q_txt).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    Transport t;

    // push anonymous shouldn't be allowed.
View Full Code Here

  }

  public void testPush_CreateBranch() throws Exception {
    final TestRepository src = createTestRepository();
    final RevBlob Q_txt = src.blob("new text");
    final RevCommit Q = src.commit().add("Q", Q_txt).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    Transport t;

    enableReceivePack();
View Full Code Here

    remoteRepository = src.getRepository();
    remoteURI = toURIish(app, srcName);

    A_txt = src.blob("A");
    A = src.commit().add("A_txt", A_txt).create();
    B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
    src.update(master, B);
  }

  public void testListRemote() throws IOException {
View Full Code Here

    remoteRepository = src.getRepository();
    remoteURI = toURIish(app, srcName);

    A_txt = src.blob("A");
    A = src.commit().add("A_txt", A_txt).create();
    B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
    src.update(master, B);
  }

  public void testListRemote() throws IOException {
    Repository dst = createBareRepository();
View Full Code Here

        HDR_CONTENT_TYPE));
  }

  public void testPushNotSupported() throws Exception {
    final TestRepository src = createTestRepository();
    final RevCommit Q = src.commit().create();
    final Repository db = src.getRepository();

    Transport t = Transport.open(db, remoteURI);
    ((TransportHttp) t).setUseSmartHttp(false);
    try {
View Full Code Here

  }

  public void testPush_CreateBranch() throws Exception {
    final TestRepository src = createTestRepository();
    final RevBlob Q_txt = src.blob("new text");
    final RevCommit Q = src.commit().add("Q", Q_txt).create();
    final Repository db = src.getRepository();
    final String dstName = Constants.R_HEADS + "new.branch";
    Transport t;
    PushResult result;
View Full Code Here

    remoteRepository = src.getRepository();
    remoteURI = toURIish(app, srcGit.getName());

    A_txt = src.blob("A");
    A = src.commit().add("A_txt", A_txt).create();
    B = src.commit().parent(A).add("A_txt", "C").add("B", "B").create();
    src.update(master, B);
  }

  public void testListRemote() throws IOException {
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.