Example usage for org.eclipse.jgit.util FS setUserHome

List of usage examples for org.eclipse.jgit.util FS setUserHome

Introduction

In this page you can find the example usage for org.eclipse.jgit.util FS setUserHome.

Prototype

public FS setUserHome(File path) 

Source Link

Document

Set the user's home directory location.

Usage

From source file:com.tasktop.c2c.server.scm.service.FetchWorkerThread.java

License:Open Source License

private void doMirrorFetch(String projectId, File mirroredRepo) {
    try {//from  www  . j a va 2 s . co  m
        // Set the home directory. This is used for configuration and ssh keys
        FS fs = FS.detect();
        fs.setUserHome(new File(repositoryProvider.getBaseDir(), projectId));
        FileRepositoryBuilder builder = new FileRepositoryBuilder().setGitDir(mirroredRepo).setFS(fs).setup();
        Git git = new Git(new FileRepository(builder));
        git.fetch().setRefSpecs(new RefSpec("refs/heads/*:refs/heads/*")).setThin(true).call();
    } catch (Exception e) {
        logger.warn("Caught exception durring fetch", e);
    }
}