Example usage for org.eclipse.jgit.transport WalkRemoteObjectDatabase getAlternates

List of usage examples for org.eclipse.jgit.transport WalkRemoteObjectDatabase getAlternates

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport WalkRemoteObjectDatabase getAlternates.

Prototype

abstract Collection<WalkRemoteObjectDatabase> getAlternates() throws IOException;

Source Link

Document

Obtain alternate connections to alternate object databases (if any).

Usage

From source file:it.com.atlassian.labs.speakeasy.util.jgit.WalkFetchConnection.java

License:Eclipse Distribution License

private Collection<WalkRemoteObjectDatabase> expandOneAlternate(final AnyObjectId id,
        final ProgressMonitor pm) {
    while (!noAlternatesYet.isEmpty()) {
        final WalkRemoteObjectDatabase wrr = noAlternatesYet.removeFirst();
        try {/*from  w w  w  . j a  v a2s. co m*/
            pm.beginTask(JGitText.get().listingAlternates, ProgressMonitor.UNKNOWN);
            Collection<WalkRemoteObjectDatabase> altList = wrr.getAlternates();
            if (altList != null && !altList.isEmpty())
                return altList;
        } catch (IOException e) {
            // Try another repository.
            //
            recordError(id, e);
        } finally {
            pm.endTask();
        }
    }
    return null;
}