本文整理了Java中org.eclipse.jgit.api.Git.submoduleUpdate()
方法的一些代码示例,展示了Git.submoduleUpdate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.submoduleUpdate()
方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:submoduleUpdate
[英]Return a command object to execute a submodule update command
[中]返回命令对象以执行子模块更新命令
代码示例来源:origin: jenkinsci/git-client-plugin
@Override
public void execute() throws GitException, InterruptedException {
if (remoteTracking) {
listener.getLogger().println("[ERROR] JGit doesn't support remoteTracking submodules yet.");
throw new UnsupportedOperationException("not implemented yet");
}
if ((ref != null) && !ref.isEmpty()) {
listener.getLogger().println("[ERROR] JGit doesn't support submodule update --reference yet.");
throw new UnsupportedOperationException("not implemented yet");
}
try (Repository repo = getRepository()) {
SubmoduleUpdateCommand update = git(repo).submoduleUpdate();
update.setCredentialsProvider(getProvider());
update.call();
if (recursive) {
for (JGitAPIImpl sub : submodules()) {
sub.submoduleUpdate(recursive);
}
}
} catch (IOException | GitAPIException e) {
throw new GitException(e);
}
}
};
代码示例来源:origin: omegat-org/omegat
try (Git git = new Git(repository)) {
git.submoduleInit().call();
git.submoduleUpdate().call();
try (Git git = new Git(repository)) {
git.submoduleInit().call();
git.submoduleUpdate().call();
内容来源于网络,如有侵权,请联系作者删除!