Examples of PullResult


Examples of org.eclipse.jgit.api.PullResult

            repository.incrementOpen();

            Git git = Git.wrap(repository);

            // Pull remote repository
            PullResult pullResult = git.pull().call();

            // Check result
            if (pullResult.getMergeResult().getMergeStatus() == MergeStatus.CONFLICTING || pullResult.getMergeResult().getMergeStatus() == MergeStatus.FAILED) {

                // TODO: How to report failure
                throw new RuntimeException(String.format("Failed to merge changes from %s", gitUri));
            }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      PullCommand pull = git.pull();
      if (timeout >= 0)
         pull.setTimeout(timeout);
      pull.setProgressMonitor(new TextProgressMonitor());

      PullResult result = pull.call();
      return result;
   }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

      assertEquals(true, pushStatus.isOK());

      // TODO: replace with RESTful API for git pull when available
      // try to pull - up to date status is expected
      Git git = new Git(getRepositoryForContentLocation(cloneContentLocation));
      PullResult pullResults = git.pull().call();
      assertEquals(Constants.DEFAULT_REMOTE_NAME, pullResults.getFetchedFrom());
      assertEquals(MergeStatus.ALREADY_UP_TO_DATE, pullResults.getMergeResult().getMergeStatus());
      assertNull(pullResults.getRebaseResult());

      // checkout branch which was created a moment ago
      response = checkoutBranch(cloneLocation, BRANCH_NAME);
      assertEquals(HttpURLConnection.HTTP_OK, response.getResponseCode());

      // TODO: replace with RESTful API for git pull when available
      // try to pull again - now fast forward update is expected
      pullResults = git.pull().call();
      assertEquals(Constants.DEFAULT_REMOTE_NAME, pullResults.getFetchedFrom());
      assertEquals(MergeStatus.FAST_FORWARD, pullResults.getMergeResult().getMergeStatus());
      assertNull(pullResults.getRebaseResult());
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

            map.put(GitConstants.KEY_COOKIE, cookie.getName() + "=" + cookie.getValue());
            ((TransportHttp) t).setAdditionalHeaders(map);
          }
        }
      });
      PullResult pullResult = pc.call();

      if (monitor.isCanceled()) {
        return new Status(IStatus.CANCEL, GitActivator.PI_GIT, "Cancelled");
      }

      // handle result
      if (pullResult.isSuccessful()) {
        return Status.OK_STATUS;
      }
      FetchResult fetchResult = pullResult.getFetchResult();

      IStatus fetchStatus = FetchJob.handleFetchResult(fetchResult);
      if (!fetchStatus.isOK()) {
        return fetchStatus;
      }

      MergeStatus mergeStatus = pullResult.getMergeResult().getMergeStatus();
      if (!mergeStatus.isSuccessful())
        return new Status(IStatus.ERROR, GitActivator.PI_GIT, mergeStatus.name());
    } finally {
      if (db != null) {
        db.close();
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

    cfg.setBoolean(ConfigConstants.CONFIG_BRANCH_SECTION, Constants.MASTER, ConfigConstants.CONFIG_KEY_REBASE, false);
    cfg.save();

    // TODO: replace with RESTful API when ready, see bug 339114
    Git git = new Git(r);
    PullResult pullResult = git.pull().call();
    assertEquals(pullResult.getMergeResult().getMergeStatus(), MergeStatus.ALREADY_UP_TO_DATE);
    assertEquals(RepositoryState.SAFE, git.getRepository().getRepositoryState());
  }
View Full Code Here

Examples of org.eclipse.jgit.api.PullResult

    // clone2: pull
    // TODO: replace with REST API for git pull once bug 339114 is fixed
    Repository db2 = getRepositoryForContentLocation(contentLocation2);
    git = new Git(db2);
    PullResult pullResult = git.pull().call();
    assertEquals(pullResult.getMergeResult().getMergeStatus(), MergeStatus.CONFLICTING);

    // this is how EGit checks for conflicts
    cache = db2.readDirCache();
    entry = cache.getEntry("test.txt");
    assertTrue(entry.getStage() > 0);
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.