/**
  * Fetches from a remote repository and tries to merge into the current branch.
  *
  * @throws WrongRepositoryStateException
  * @throws InvalidConfigurationException
  * @throws DetachedHeadException
  * @throws InvalidRemoteException
  * @throws CanceledException
  * @throws RefNotFoundException
  * @throws NoHeadException
  * @throws TransportException
  * @throws GitAPIException
  */
 public void pull()
     throws WrongRepositoryStateException, InvalidConfigurationException, DetachedHeadException,
         InvalidRemoteException, CanceledException, RefNotFoundException, NoHeadException,
         TransportException, GitAPIException {
   PullCommand pullCommand = git.pull();
   pullCommand.call();
 }
Beispiel #2
0
  public static PullResult pull(final Git git, final int timeout) throws GitAPIException {
    PullCommand pull = git.pull();
    if (timeout >= 0) pull.setTimeout(timeout);
    pull.setProgressMonitor(new TextProgressMonitor());

    PullResult result = pull.call();
    return result;
  }
 /*
  * (non-Javadoc)
  *
  * @see nl.minicom.gitolite.manager.git.GitManager#pull()
  */
 @Override
 public boolean pull() throws IOException, ServiceUnavailable {
   try {
     PullCommand pull = git.pull();
     return !pull.call().getFetchResult().getTrackingRefUpdates().isEmpty();
   } catch (NullPointerException e) {
     throw new ServiceUnavailable(e);
   } catch (GitAPIException e) {
     throw new IOException(e);
   }
 }