当前位置: 首页>>代码示例>>Java>>正文


Java Repository.getWorkTree方法代码示例

本文整理汇总了Java中org.eclipse.jgit.lib.Repository.getWorkTree方法的典型用法代码示例。如果您正苦于以下问题:Java Repository.getWorkTree方法的具体用法?Java Repository.getWorkTree怎么用?Java Repository.getWorkTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.lib.Repository的用法示例。


在下文中一共展示了Repository.getWorkTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.eclipse.jgit.lib.Repository; //导入方法依赖的package包/类
@Override
protected void run () throws GitException {
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    org.eclipse.jgit.api.SubmoduleStatusCommand cmd = new Git(repository).submoduleStatus();
    for (String path : Utils.getRelativePaths(workTree, roots)) {
        cmd.addPath(path);
    }
    try {
        Map<String, SubmoduleStatus> result = cmd.call();
        GitClassFactory fac = getClassFactory();
        for (Map.Entry<String, SubmoduleStatus> e : result.entrySet()) {
            File root = new File(workTree, e.getKey());
            statuses.put(root, fac.createSubmoduleStatus(e.getValue(), root));
        }
    } catch (GitAPIException | JGitInternalException ex) {
        throw new GitException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:SubmoduleStatusCommand.java

示例2: createResult

import org.eclipse.jgit.lib.Repository; //导入方法依赖的package包/类
private GitRebaseResult createResult (RebaseResult res) {
    String currHead;
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    try {
        currHead = repository.resolve(Constants.HEAD).name();
    } catch (IOException ex) {
        currHead = Constants.HEAD;
    }
    List<File> conflicts;
    if (res.getStatus() == RebaseResult.Status.STOPPED) {
        conflicts = getConflicts(res.getCurrentCommit());
    } else {
        conflicts = Collections.<File>emptyList();
    }
    return getClassFactory().createRebaseResult(res, conflicts, getFailures(res), currHead);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:RebaseCommand.java

示例3: run

import org.eclipse.jgit.lib.Repository; //导入方法依赖的package包/类
@Override
protected void run () throws GitException {
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    org.eclipse.jgit.api.SubmoduleInitCommand cmd = new Git(repository).submoduleInit();
    for (String path : Utils.getRelativePaths(workTree, roots)) {
        cmd.addPath(path);
    }
    try {
        cmd.call();
        statusCmd.run();
    } catch (GitAPIException | JGitInternalException ex) {
        throw new GitException(ex);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:SubmoduleInitializeCommand.java


注:本文中的org.eclipse.jgit.lib.Repository.getWorkTree方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。