checkCallable(); if (baseUri == null) { baseUri = ""; //$NON-NLS-1$ if (callback == null) callback = new DefaultRemoteReader(); List<RepoProject> renamedProjects = renameProjects(filteredProjects); submodUrl = relativize(targetUri, submodUrl); try (Git git = new Git(repo)) { for (RepoProject proj : filteredProjects) { addSubmodule(proj.getName(), proj.getUrl(), proj.getPath(), proj.getRevision(), proj.getCopyFiles(), proj.getLinkFiles(), git);
private void addSubmodule(String name, String url, String path, String revision, List<CopyFile> copyfiles, List<LinkFile> linkfiles, Git git) throws GitAPIException, IOException { assert (!repo.isBare()); assert (git != null); if (!linkfiles.isEmpty()) { throw new UnsupportedOperationException( JGitText.get().nonBareLinkFilesNotSupported); } SubmoduleAddCommand add = git.submoduleAdd().setName(name).setPath(path) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); Repository subRepo = add.call(); if (revision != null) { try (Git sub = new Git(subRepo)) { sub.checkout().setName(findRef(revision, subRepo)).call(); } subRepo.close(); git.add().addFilepattern(path).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } }
@Override protected void run() throws Exception { new RepoCommand(db) .setURI(uri) .setPath(path) .setGroups(groups) .call(); } }
@Override public RevCommit call() throws GitAPIException { try { checkCallable(); if (uri == null || uri.length() == 0) throw new IllegalArgumentException( parser.read(inputStream); for (RepoProject proj : parser.getFilteredProjects()) { addSubmodule(proj.getUrl(), proj.getPath(), proj.getRevision(),
checkCallable(); if (baseUri == null) { baseUri = ""; //$NON-NLS-1$ if (callback == null) callback = new DefaultRemoteReader(); List<RepoProject> renamedProjects = renameProjects(filteredProjects); submodUrl = relativize(targetUri, submodUrl); try (Git git = new Git(repo)) { for (RepoProject proj : filteredProjects) { addSubmodule(proj.getName(), proj.getUrl(), proj.getPath(), proj.getRevision(), proj.getCopyFiles(), proj.getLinkFiles(), git);
private void addSubmodule(String name, String url, String path, String revision, List<CopyFile> copyfiles, List<LinkFile> linkfiles, Git git) throws GitAPIException, IOException { assert (!repo.isBare()); assert (git != null); if (!linkfiles.isEmpty()) { throw new UnsupportedOperationException( JGitText.get().nonBareLinkFilesNotSupported); } SubmoduleAddCommand add = git.submoduleAdd().setName(name).setPath(path) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); Repository subRepo = add.call(); if (revision != null) { try (Git sub = new Git(subRepo)) { sub.checkout().setName(findRef(revision, subRepo)).call(); } subRepo.close(); git.add().addFilepattern(path).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } }
private void addSubmodule(String url, String name, String revision, List<CopyFile> copyfiles, Set<String> groups, String recommendShallow) throws GitAPIException, IOException { if (repo.isBare()) { RepoProject proj = new RepoProject(url, name, revision, null, groups, recommendShallow); proj.addCopyFiles(copyfiles); bareProjects.add(proj); } else { SubmoduleAddCommand add = git .submoduleAdd() .setPath(name) .setURI(url); if (monitor != null) add.setProgressMonitor(monitor); Repository subRepo = add.call(); if (revision != null) { try (Git sub = new Git(subRepo)) { sub.checkout().setName(findRef(revision, subRepo)) .call(); } subRepo.close(); git.add().addFilepattern(name).call(); } for (CopyFile copyfile : copyfiles) { copyfile.copy(); git.add().addFilepattern(copyfile.dest).call(); } } }