Package org.eclipse.egit.core.op

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


    untracked.addAll(Arrays.asList(commitables));
    // commit to stable
    CommitOperation op = new CommitOperation(commitables,
        untracked, TestUtil.TESTAUTHOR, TestUtil.TESTCOMMITTER,
        "Initial commit");
    op.execute(null);

    // now create a stable branch (from master)
    createStableBranch(myRepository);
    // and check in some stuff into master again
    touchAndSubmit(null);
View Full Code Here


    if (message == null)
      message = newContent;
    CommitOperation op = new CommitOperation(commitables,
        untracked, TestUtil.TESTAUTHOR, TestUtil.TESTCOMMITTER,
        message);
    op.execute(null);
  }

  /**
   * Modify with the given content.
   *
 
View Full Code Here

    ArrayList<IFile> untracked = new ArrayList<IFile>();
    untracked.addAll(Arrays.asList(commitables));
    CommitOperation op = new CommitOperation(commitables,
        untracked, TestUtil.TESTAUTHOR, TestUtil.TESTCOMMITTER,
        commitMessage);
    op.execute(null);
  }

  protected static void setTestFileContent(String newContent)
      throws Exception {
    IProject prj = ResourcesPlugin.getWorkspace().getRoot().getProject(
View Full Code Here

    untracked.addAll(Arrays.asList(commitables));

    CommitOperation op = new CommitOperation(commitables,
        untracked, TestUtil.TESTAUTHOR, TestUtil.TESTCOMMITTER,
        "Add .gitignore file");
    op.execute(null);
  }

  protected void commit(String projectName) throws InterruptedException {
    showDialog(projectName, "Team", "Commit...");
View Full Code Here

    resources.add(project.getProject().getFolder("foo"));
    new AddToIndexOperation(resources).execute(null);
    CommitOperation commitOperation = new CommitOperation(null, null, TestUtils.AUTHOR, TestUtils.COMMITTER, "first commit");
    commitOperation.setCommitAll(true);
    commitOperation.setRepository(repository);
    commitOperation.execute(null);

    testUtils.addFileToProject(project.getProject(), "zar/b.txt", "some text");
    resources.add(project.getProject().getFolder("zar"));
    new AddToIndexOperation(resources).execute(null);
    IFile zarFile = project.getProject().getFile("zar/b.txt");
View Full Code Here

    IFile[] filesToCommit = new IFile[] { project.getProject().getFile("zar/b.txt") };
    commitOperation = new CommitOperation(filesToCommit, null, TestUtils.AUTHOR, TestUtils.COMMITTER, "first commit");
    commitOperation.setRepository(repository);
    try {
      commitOperation.execute(null);
      // TODO this is very ugly. CommitCommand should be extended
      // not to throw an JGitInternalException in case of an empty
      // commit
      fail("expected CoreException");
    } catch (CoreException e) {
View Full Code Here

    new AddToIndexOperation(resources).execute(null);
    CommitOperation commitOperation = new CommitOperation(null, null, TestUtils.AUTHOR,
        TestUtils.COMMITTER, "first commit");
    commitOperation.setCommitAll(true);
    commitOperation.setRepository(repository);
    commitOperation.execute(null);

    Git git = new Git(repository);
    Iterator<RevCommit> commits = git.log().call().iterator();
    RevCommit firstCommit = commits.next();
    assertTrue(firstCommit.getCommitTime() > 0);
View Full Code Here

    commitOperation = new CommitOperation(null, null, TestUtils.AUTHOR,
        TestUtils.COMMITTER, "second commit");
    commitOperation.setCommitAll(true);
    commitOperation.setRepository(repository);
    commitOperation.execute(null);

    git = new Git(repository);
    commits = git.log().call().iterator();
    RevCommit secondCommit = commits.next();
    assertTrue(secondCommit.getCommitTime() > 0);
View Full Code Here

    new AddToIndexOperation(resources).execute(null);
    CommitOperation commitOperation = new CommitOperation(null, null, TestUtils.AUTHOR,
        TestUtils.COMMITTER, "first commit");
    commitOperation.setCommitAll(true);
    commitOperation.setRepository(repository);
    commitOperation.execute(null);

    Git git = new Git(repository);
    Iterator<RevCommit> commits = git.log().call().iterator();
    RevCommit secondCommit = commits.next();
    TreeWalk treeWalk = new TreeWalk(repository);
View Full Code Here

    ArrayList<IFile> notIndexed = new ArrayList<IFile>();
    notIndexed.add(filesToCommit[0]);
    ArrayList<IFile> notTracked = new ArrayList<IFile>();
    commitOperation = new CommitOperation(filesToCommit, notTracked, TestUtils.AUTHOR, TestUtils.COMMITTER, "second commit");
    commitOperation.setCommitAll(false);
    commitOperation.execute(null);

    git = new Git(repository);
    commits = git.log().call().iterator();
    secondCommit = commits.next();
    treeWalk = new TreeWalk(repository);
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.