org.eclipse.jgit.api.Git.submoduleUpdate()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中org.eclipse.jgit.api.Git.submoduleUpdate()方法的一些代码示例,展示了Git.submoduleUpdate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.submoduleUpdate()方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:submoduleUpdate

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();

相关文章