Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.Git.push()


      assertFalse("User canAdmin:" + user.canAdmin + " canCreate:" + user.canCreate, user.canAdmin || user.canCreate);
    }

    // push to non-existent project repository
    try {
      Iterable<PushResult> results = git.push().setRemote("project").setPushAll().setCredentialsProvider(cp).call();
      GitBlitSuite.close(git);

      for (PushResult result : results) {
        RemoteRefUpdate ref = result.getRemoteUpdate("refs/heads/master");
        Status status = ref.getStatus();
View Full Code Here


    // unfreeze repo
    model.isFrozen = false;
    repositories().updateRepositoryModel(model.name, model, false);

    results = git.push().setPushAll().call();
    GitBlitSuite.close(git);
    for (PushResult result : results) {
      for (RemoteRefUpdate update : result.getRemoteUpdates()) {
        assertEquals(Status.OK, update.getStatus());
      }
View Full Code Here

    w.write("// " + new Date().toString() + "\n");
    w.close();
    git.add().addFilepattern(file.getName()).call();
    git.commit().setMessage("test commit followed by push to non-bare repository").call();

    Iterable<PushResult> results = git.push().setPushAll().call();
    GitBlitSuite.close(git);

    for (PushResult result : results) {
      for (RemoteRefUpdate update : result.getRemoteUpdates()) {
        assertEquals(Status.REJECTED_OTHER_REASON, update.getStatus());
View Full Code Here

    BufferedWriter w = new BufferedWriter(os);
    w.write("// hellol中文 " + new Date().toString() + "\n");
    w.close();
    git.add().addFilepattern(file.getName()).call();
    git.commit().setMessage("test commit").call();
    Iterable<PushResult> results = git.push().setPushAll().call();
    GitBlitSuite.close(git);
    for (PushResult result : results) {
      for (RemoteRefUpdate update : result.getRemoteUpdates()) {
        assertEquals(Status.OK, update.getStatus());
      }
View Full Code Here

    BufferedWriter w = new BufferedWriter(os);
    w.write("// hellol中文 " + new Date().toString() + "\n");
    w.close();
    git.add().addFilepattern(file.getName()).call();
    git.commit().setMessage("test commit").call();
    Iterable<PushResult> results = git.push().setPushAll().call();
    GitBlitSuite.close(git);
    for (PushResult result : results) {
      for (RemoteRefUpdate update : result.getRemoteUpdates()) {
        assertEquals(Status.REJECTED_OTHER_REASON, update.getStatus());
      }
View Full Code Here

    w.write("// " + new Date().toString() + "\n");
    w.close();
    git.add().addFilepattern(file.getName()).call();
    git.commit().setMessage("test commit").call();

    Iterable<PushResult> results = git.push().call();
    for (PushResult result : results) {
      for (RemoteRefUpdate update : result.getRemoteUpdates()) {
        assertEquals(Status.REJECTED_OTHER_REASON, update.getStatus());
      }
    }
View Full Code Here

  private boolean shownURI;

  @Override
  protected void run() throws Exception {
    Git git = new Git(db);
    PushCommand push = git.push();
    push.setDryRun(dryRun);
    push.setForce(force);
    push.setProgressMonitor(new TextProgressMonitor());
    push.setReceivePack(receivePack);
    push.setRefSpecs(refSpecs);
View Full Code Here

    assertEquals(0, git.branchList().setListMode(ListMode.REMOTE).call().size() - remoteBefore);
    assertEquals(1, git.branchList().setListMode(ListMode.ALL).call().size() - allBefore);

    // push all
    // TODO: replace with REST API when bug 339115 is fixed
    git.push().setPushAll().call();

    assertEquals(1, git.branchList().call().size() - localBefore);
    assertEquals(1, git.branchList().setListMode(ListMode.REMOTE).call().size() - remoteBefore);
    assertEquals(2, git.branchList().setListMode(ListMode.ALL).call().size() - allBefore);
View Full Code Here

    JSONObject result = new JSONObject();
    try {
      db = FileRepositoryBuilder.create(gitDir);
      Git git = new Git(db);

      PushCommand pushCommand = git.push();
      pushCommand.setProgressMonitor(gitMonitor);
      pushCommand.setTransportConfigCallback(new TransportConfigCallback() {
        @Override
        public void configure(Transport t) {
          credentials.setUri(t.getURI());
View Full Code Here

    Git git1 = new Git(db1);
    branch(branchesLocation1, "a");

    // clone1: push all
    // TODO: replace with REST API when bug 339115 is fixed
    git1.push().setPushAll().call();

    // clone2
    JSONObject project2 = createProjectOrLink(workspaceLocation, getMethodName().concat("Project2"), null);
    IPath clonePath2 = getClonePath(workspaceId, project2);
    JSONObject clone2 = clone(clonePath2);
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.