Example usage for org.eclipse.jgit.transport Transport isCheckFetchedObjects

List of usage examples for org.eclipse.jgit.transport Transport isCheckFetchedObjects

Introduction

In this page you can find the example usage for org.eclipse.jgit.transport Transport isCheckFetchedObjects.

Prototype

public boolean isCheckFetchedObjects() 

Source Link

Document

Whether fetch will verify if received objects are formatted correctly.

Usage

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

License:Eclipse Distribution License

WalkFetchConnection(final WalkTransport t, final WalkRemoteObjectDatabase w) {
    Transport wt = (Transport) t;
    try {/*from   w ww .ja va2  s . c  o  m*/
        local = (Repository) wt.getClass().getDeclaredField("local").get(wt);
    } catch (IllegalAccessException e) {
        throw new RuntimeException(e);
    } catch (NoSuchFieldException e) {
        throw new RuntimeException(e);
    }
    objCheck = wt.isCheckFetchedObjects() ? new ObjectChecker() : null;
    inserter = local.newObjectInserter();
    reader = local.newObjectReader();

    remotes = new ArrayList<WalkRemoteObjectDatabase>();
    remotes.add(w);

    unfetchedPacks = new LinkedList<RemotePack>();
    packsConsidered = new HashSet<String>();

    noPacksYet = new LinkedList<WalkRemoteObjectDatabase>();
    noPacksYet.add(w);

    noAlternatesYet = new LinkedList<WalkRemoteObjectDatabase>();
    noAlternatesYet.add(w);

    fetchErrors = new HashMap<ObjectId, List<Throwable>>();
    packLocks = new ArrayList<PackLock>(4);

    revWalk = new RevWalk(reader);
    revWalk.setRetainBody(false);
    treeWalk = new TreeWalk(reader);
    COMPLETE = revWalk.newFlag("COMPLETE");
    IN_WORK_QUEUE = revWalk.newFlag("IN_WORK_QUEUE");
    LOCALLY_SEEN = revWalk.newFlag("LOCALLY_SEEN");

    localCommitQueue = new DateRevQueue();
    workQueue = new LinkedList<ObjectId>();
}