Example usage for org.eclipse.jgit.lib Repository stripWorkDir

List of usage examples for org.eclipse.jgit.lib Repository stripWorkDir

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib Repository stripWorkDir.

Prototype

@NonNull
public static String stripWorkDir(File workDir, File file) 

Source Link

Document

Strip work dir and return normalized repository path.

Usage

From source file:org.nbgit.ui.browser.BrowserModel.java

License:Open Source License

public BrowserModel(Set<File> fileSet, String... ids) {
    File[] files = fileSet.toArray(new File[fileSet.size()]);
    File root = Git.getInstance().getTopmostManagedParent(files[0]);
    repository = Git.getInstance().getRepository(root);
    for (File file : files) {
        file = file.getAbsoluteFile();// www  .j  a  v  a2s.c  o  m
        // If the work directory root is included disable path limiting.
        if (file.getPath().length() == root.getPath().length()) {
            paths.clear();
            break;
        }
        paths.add(Repository.stripWorkDir(root, file));
    }
    this.ids = ids;
}