Package org.eclipse.egit.core.op

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


      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) {
        monitor.beginTask("", 1); //$NON-NLS-1$
        try {
          op.execute(monitor);
          RevCommit commit = op.getCommit();
          if (commit == null)
            showNoChangesToStash();

        } catch (CoreException e) {
View Full Code Here


  public void testDefaultMessage() throws Exception {
    IFile file = testUtils.addFileToProject(project.getProject(),
        "foo/a.txt", "some text");
    new AddToIndexOperation(Arrays.asList(file)).execute(null);
    StashCreateOperation stashCreateOperation = new StashCreateOperation(repository);
    stashCreateOperation.execute(null);

    RevWalk revWalk = new RevWalk(repository);
    RevCommit commit = revWalk.parseCommit(repository.resolve("stash@{0}"));
    assertTrue(commit.getFullMessage().length() > 0);
  }
View Full Code Here

    IFile file = testUtils.addFileToProject(project.getProject(),
        "foo/a.txt", "some text");
    new AddToIndexOperation(Arrays.asList(file)).execute(null);
    String message = "stash message";
    StashCreateOperation stashCreateOperation = new StashCreateOperation(repository, message);
    stashCreateOperation.execute(null);

    RevWalk revWalk = new RevWalk(repository);
    RevCommit commit = revWalk.parseCommit(repository.resolve("stash@{0}"));
    assertEquals(message, commit.getFullMessage());
  }
View Full Code Here

    testUtils.addFileToProject(project.getProject(), "foo/untracked.txt",
        "some text");
    String message = "stash with untracked files";
    StashCreateOperation stashCreateOperation = new StashCreateOperation(
        repository, message, true);
    stashCreateOperation.execute(null);

    RevWalk revWalk = new RevWalk(repository);
    RevCommit commit = revWalk.parseCommit(repository.resolve("stash@{0}"));
    // untracked commit is the third parent
    assertEquals(commit.getParentCount(), 3);
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.