Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.AddToIndexOperation.execute()


    String jobname = UIText.AddToIndexAction_addingFiles;
    Job job = new Job(jobname) {
      @Override
      protected IStatus run(IProgressMonitor monitor) {
        try {
          operation.execute(monitor);
        } catch (CoreException e) {
          return Activator.createErrorStatus(e.getStatus()
              .getMessage(), e);
        }
        return Status.OK_STATUS;
View Full Code Here


  public void markAsMerged(IDiff node, boolean inSyncHint,
      IProgressMonitor monitor) throws CoreException {
    IResource resource = getDiffTree().getResource(node);
    AddToIndexOperation operation = new AddToIndexOperation(
        new IResource[] { resource });
    operation.execute(monitor);
  }

  public void reject(IDiff diff, IProgressMonitor monitor)
      throws CoreException {
    // TODO Auto-generated method stub
View Full Code Here

  protected static void stage(IFile file) throws Exception {
    ArrayList<IFile> unstaged = new ArrayList<IFile>();
    unstaged.addAll(Arrays.asList(new IFile[] { file }));
    AddToIndexOperation op = new AddToIndexOperation(unstaged);
    op.execute(null);
  }

  protected static void addAndCommit(IFile file, String commitMessage)
      throws Exception {
    IProject prj = file.getProject();
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

    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

        "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

    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

    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

        "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

TOP
Copyright © 2018 www.massapi.com. 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.