.getBytes(firstProject.getDefaultCharset())), false, null);
IFile textFile2 = folder.getFile(FILE2);
textFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
new ConnectProviderOperation(firstProject, gitDir).execute(null);
IProject secondProject = ResourcesPlugin.getWorkspace().getRoot()
.getProject(PROJ2);
if (secondProject.exists())
secondProject.delete(true, null);
desc = ResourcesPlugin.getWorkspace().newProjectDescription(PROJ2);
desc.setLocation(new Path(new File(myRepository.getWorkTree(), PROJ2)
.getPath()));
secondProject.create(desc, null);
secondProject.open(null);
IFolder secondfolder = secondProject.getFolder(FOLDER);
secondfolder.create(false, true, null);
IFile secondtextFile = secondfolder.getFile(FILE1);
secondtextFile.create(new ByteArrayInputStream("Hello, world"
.getBytes(firstProject.getDefaultCharset())), false, null);
IFile secondtextFile2 = secondfolder.getFile(FILE2);
secondtextFile2.create(new ByteArrayInputStream("Some more content"
.getBytes(firstProject.getDefaultCharset())), false, null);
// TODO we should be able to hide the .project
// IFile gitignore = secondPoject.getFile(".gitignore");
// gitignore.create(new ByteArrayInputStream("/.project\n"
// .getBytes(firstProject.getDefaultCharset())), false, null);
new ConnectProviderOperation(secondProject, gitDir).execute(null);
IFile[] commitables = new IFile[] { firstProject.getFile(".project"),
textFile, textFile2, secondtextFile, secondtextFile2 };
ArrayList<IFile> untracked = new ArrayList<IFile>();
untracked.addAll(Arrays.asList(commitables));