Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.AddToIndexOperation


        "new content of A");
    testUtils.changeContentOfFile(project.getProject(), fileB,
        "new content of B");
    resources.add(fileA);
    resources.add(fileB);
    new AddToIndexOperation(resources).execute(null);
    commitOperation = new CommitOperation(filesToCommit, EMPTY_FILE_LIST,
        TestUtils.AUTHOR, TestUtils.COMMITTER, "second commit");
    commitOperation.execute(null);

    testUtils.assertRepositoryContainsFilesWithContent(repository,
View Full Code Here


        "new content of A");
    testUtils.changeContentOfFile(project.getProject(), fileB,
        "new content of B");
    resources.add(fileA);
    resources.add(fileB);
    new AddToIndexOperation(resources).execute(null);
    IFile[] filesToCommit2 = { fileA };
    commitOperation = new CommitOperation(filesToCommit2, EMPTY_FILE_LIST,
        TestUtils.AUTHOR, TestUtils.COMMITTER, "second commit");
    commitOperation.execute(null);
View Full Code Here

    IFile[] fileArr = files.toArray(new IFile[files.size()]);

    assertTrackedState(fileArr, false);

    AddToIndexOperation trop = new AddToIndexOperation(files);
    trop.execute(new NullProgressMonitor());

    assertTrackedState(fileArr, true);

    UntrackOperation utop = new UntrackOperation(Arrays.asList(fileArr));
View Full Code Here

    IFile[] fileArr = files.toArray(new IFile[files.size()]);

    assertTrackedState(fileArr, false);

    AddToIndexOperation trop = new AddToIndexOperation(containers);
    trop.execute(new NullProgressMonitor());

    assertTrackedState(fileArr, true);

    UntrackOperation utrop = new UntrackOperation(containers);
    utrop.execute(new NullProgressMonitor());
View Full Code Here

    TestProject project = initRepoInsideProjectInsideWorkspace();
    testUtils.addFileToProject(project.getProject(), "file.txt",
        "some text");
    testUtils.addFileToProject(project.getProject(), "file2.txt",
        "some  more text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] { project.getProject().getFile("file.txt"),
            project.getProject().getFile("file2.txt") });
    addToIndexOperation.execute(null);

    // Validate pre-conditions
    DirCache dirCache = DirCache.read(repository.getIndexFile(),
        FS.DETECTED);
    assertEquals(2, dirCache.getEntryCount());
View Full Code Here

    TestProject project = initRepoInsideProjectInsideWorkspace();
    testUtils.addFileToProject(project.getProject(), "folder/file.txt",
        "some text");
    testUtils.addFileToProject(project.getProject(), "folder2/file.txt",
        "some other text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] {
            project.getProject().getFile("folder/file.txt"),
            project.getProject().getFile("folder2/file.txt") });
    addToIndexOperation.execute(null);

    DirCache dirCache = DirCache.read(repository.getIndexFile(),
        FS.DETECTED);
    assertNotNull(dirCache.getEntry("folder/file.txt"));
    assertNotNull(dirCache.getEntry("folder2/file.txt"));
View Full Code Here

  @Test
  public void testDeleteProject() throws Exception {
    TestProject project = initRepoAboveProjectInsideWs("P/", "");
    testUtils.addFileToProject(project.getProject(), "file.txt",
        "some text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] { project.getProject().getFile("file.txt") });
    addToIndexOperation.execute(null);

    RepositoryMapping mapping = RepositoryMapping.getMapping(project
        .getProject());
    IPath gitDirAbsolutePath = mapping.getGitDirAbsolutePath();
    Repository db = FileRepositoryBuilder.create(gitDirAbsolutePath
View Full Code Here

    TestProject project = initRepoInsideProjectInsideWorkspace();
    testUtils.addFileToProject(project.getProject(), "file.txt",
        "some text");
    testUtils.addFileToProject(project.getProject(), "file2.txt",
        "some  more text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] { project.getProject().getFile("file.txt"),
            project.getProject().getFile("file2.txt") });
    addToIndexOperation.execute(null);

    // Validate pre-conditions
    DirCache dirCache = DirCache.read(repository.getIndexFile(),
        FS.DETECTED);
    assertNotNull(dirCache.getEntry("file.txt"));
View Full Code Here

    TestProject project = initRepoInsideProjectInsideWorkspace();
    testUtils.addFileToProject(project.getProject(), "folder/file.txt",
        "some text");
    testUtils.addFileToProject(project.getProject(), "folder2/file.txt",
        "some other text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] {
            project.getProject().getFile("folder/file.txt"),
            project.getProject().getFile("folder2/file.txt") });
    addToIndexOperation.execute(null);

    DirCache dirCache = DirCache.read(repository.getIndexFile(),
        FS.DETECTED);
    assertNotNull(dirCache.getEntry("folder/file.txt"));
    assertNotNull(dirCache.getEntry("folder2/file.txt"));
View Full Code Here

    ResourcesPlugin.getWorkspace().getRoot().getProject("P2").delete(true, null);

    TestProject project = initRepoInsideProjectInsideWorkspace();
    testUtils.addFileToProject(project.getProject(), "file.txt",
        "some text");
    AddToIndexOperation addToIndexOperation = new AddToIndexOperation(
        new IResource[] { project.getProject().getFile("file.txt") });
    addToIndexOperation.execute(null);
    IProjectDescription description = project.getProject().getDescription();
    description.setName("P2");
    registerWorkspaceRelativeTestDir("P2");
    project.getProject().move(description,
        IResource.FORCE | IResource.SHALLOW, null);
View Full Code Here

TOP

Related Classes of org.eclipse.egit.core.op.AddToIndexOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.