if (repo.isBare()) {
Project proj = new Project(url, name, revision, null, null);
proj.copyfiles.addAll(copyfiles);
bareProjects.add(proj);
} else {
SubmoduleAddCommand add = git
.submoduleAdd()
.setPath(name)
.setURI(url);
if (monitor != null)
add.setProgressMonitor(monitor);
try {
Repository subRepo = add.call();
if (revision != null) {
Git sub = new Git(subRepo);
sub.checkout().setName(findRef(revision, subRepo)).call();
git.add().addFilepattern(name).call();
}