private void fetch() { FetchCommand fetchCommand = Git.wrap(git).fetch(); try { fetchCommand.setThin(true).call(); } catch (Exception e) { log.error("Failed to perform fetch", e); } }
command.setDryRun(settings.valueOfIndex("dryRun").toBoolean()); command.setRemoveDeletedRefs(settings.valueOfIndex("removeDeletedRefs").toBoolean()); command.setThin(settings.valueOfIndex("thin").toBoolean());
.setCheckFetchedObjects(checkFetchedObjects) .setRemoveDeletedRefs(isRemoveDeletedRefs()) .setThin(thin) .setRefSpecs(applyOptions(refSpecs)) .setDryRun(dryRun)
@Override protected void run() throws Exception { Git git = new Git(db); FetchCommand fetch = git.fetch(); if (fsck != null) fetch.setCheckFetchedObjects(fsck.booleanValue()); if (prune != null) fetch.setRemoveDeletedRefs(prune.booleanValue()); if (toget != null) fetch.setRefSpecs(toget); if (tags != null) { fetch.setTagOpt(tags.booleanValue() ? TagOpt.FETCH_TAGS : TagOpt.NO_TAGS); } if (0 <= timeout) fetch.setTimeout(timeout); fetch.setDryRun(dryRun); fetch.setRemote(remote); if (thin != null) fetch.setThin(thin.booleanValue()); if (quiet == null || !quiet.booleanValue()) fetch.setProgressMonitor(new TextProgressMonitor()); FetchResult result = fetch.call(); if (result.getTrackingRefUpdates().isEmpty()) return; showFetchResult(result); } }
@Override public FetchResult fetch(final Git git, final String remote, final String refSpec, final int timeout, final boolean fsck, final boolean dryRun, final boolean thin, final boolean prune) throws GitAPIException { FetchCommand fetch = git.fetch(); fetch.setCheckFetchedObjects(fsck); fetch.setRemoveDeletedRefs(prune); if (refSpec != null) fetch.setRefSpecs(new RefSpec(refSpec)); if (timeout >= 0) fetch.setTimeout(timeout); fetch.setDryRun(dryRun); fetch.setRemote(remote); fetch.setThin(thin); fetch.setProgressMonitor(new TextProgressMonitor()); FetchResult result = fetch.call(); return result; }
.setCheckFetchedObjects(checkFetchedObjects) .setRemoveDeletedRefs(isRemoveDeletedRefs()) .setThin(thin) .setRefSpecs(applyOptions(refSpecs)) .setDryRun(dryRun)