本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}