本文整理匯總了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);
}
}