Example usage for org.eclipse.jgit.internal.storage.file GC packRefs

List of usage examples for org.eclipse.jgit.internal.storage.file GC packRefs

Introduction

In this page you can find the example usage for org.eclipse.jgit.internal.storage.file GC packRefs.

Prototype

public void packRefs() throws IOException 

Source Link

Document

Pack ref storage.

Usage

From source file:org.eclipse.orion.server.git.jobs.GitJobUtils.java

License:Open Source License

/**
 * Calls pack refs for a given repository
 * /*from  w ww .jav  a 2  s.  c  o  m*/
 * @param Repository
 *            the git repository
 */
public static void packRefs(Repository repo, ProgressMonitor monitor) {
    if (repo != null && repo instanceof FileRepository) {
        GC gc = new GC(((FileRepository) repo));
        gc.setProgressMonitor(monitor);
        try {
            gc.packRefs();
        } catch (IOException ex) {
            // ignore IOException since packing is an optimization (not essential for the callers doClone/doFetch) 
        }
    }
}