Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.PersonIdent


    if (oldRef != null) {
      // rename old ref to refs/meta/gitblit/tickets
      RefRename cmd;
      try {
        cmd = db.renameRef(oldRef.getName(), BRANCH);
        cmd.setRefLogIdent(new PersonIdent("Gitblit", "gitblit@localhost"));
        cmd.setRefLogMessage("renamed " + oldRef.getName() + " => " + BRANCH);
        Result res = cmd.rename();
        switch (res) {
        case RENAMED:
          log.info(db.getDirectory() + " " + cmd.getRefLogMessage());
View Full Code Here


    try {
      // Create the in-memory index of the new/updated ticket
      ObjectId indexTreeId = index.writeTree(odi);

      // Create a commit object
      PersonIdent ident = new PersonIdent(author, "gitblit@localhost");
      CommitBuilder commit = new CommitBuilder();
      commit.setAuthor(ident);
      commit.setCommitter(ident);
      commit.setEncoding(Constants.ENCODING);
      commit.setMessage(message);
View Full Code Here

   * @throws Exception
   */
  @Test
  public void committerFilter() throws Exception {
    add("file.txt", "a");
    PersonIdent findUser = new PersonIdent("find user", "find@user.com");
    committer = findUser;
    RevCommit commit1 = add("file.txt", "b");
    RevCommit commit2 = add("file.txt", "c");
    CommitterFilter filter = new CommitterFilter(findUser);
    CommitListFilter commits = new CommitListFilter();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void committerSetFilter() throws Exception {
    add("file.txt", "a");
    PersonIdent findUser = new PersonIdent("find user", "find@user.com");
    committer = findUser;
    add("file.txt", "b");
    CommitterSetFilter filter = new CommitterSetFilter();
    assertTrue(filter.getPersons().isEmpty());
    assertFalse(filter.getPersons().contains(findUser));
View Full Code Here

   * @throws Exception
   */
  @Test
  public void sortLatestFirst() throws Exception {
    RevCommit commit = add("test.txt", "content");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void sortEarliestFirst() throws Exception {
    RevCommit commit = add("test.txt", "content");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void sortMostFirst() throws Exception {
    RevCommit commit = add("test.txt", "content");
    author = new PersonIdent(author, new Date(
        System.currentTimeMillis() + 5000));
    add("a", "b.txt");
    author = new PersonIdent("abcd", "a@b.d", new Date(
        System.currentTimeMillis() + 5000), TimeZone.getDefault());
    RevCommit commit2 = add("test.txt", "content2");
    CommitFinder finder = new CommitFinder(testRepo);
    CommitHistogramFilter filter = new AuthorHistogramFilter();
    finder.setFilter(filter).find();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void authorFilter() throws Exception {
    add("file.txt", "a");
    PersonIdent findUser = new PersonIdent("find user", "find@user.com");
    author = findUser;
    RevCommit commit1 = add("file.txt", "b");
    RevCommit commit2 = add("file.txt", "c");
    AuthorFilter filter = new AuthorFilter(findUser);
    CommitListFilter commits = new CommitListFilter();
View Full Code Here

   * @throws Exception
   */
  @Test
  public void authorSetFilter() throws Exception {
    add("file.txt", "a");
    PersonIdent findUser = new PersonIdent("find user", "find@user.com");
    author = findUser;
    add("file.txt", "b");
    AuthorSetFilter filter = new AuthorSetFilter();
    assertTrue(filter.getPersons().isEmpty());
    assertFalse(filter.getPersons().contains(findUser));
View Full Code Here

   * @throws Exception
   */
  @Test
  public void matchNameOnly() throws Exception {
    add("file.txt", "a");
    author = new PersonIdent("franklin", "test@test.com");
    RevCommit commit2 = add("file.txt", "b");
    author = new PersonIdent("franklin", "test@test.org");
    RevCommit commit3 = add("file.txt", "c");
    AuthorFilter filter = new AuthorFilter("franklin", null);
    CommitListFilter commits = new CommitListFilter();
    CommitFinder service = new CommitFinder(testRepo);
    service.setFilter(new AndCommitFilter().add(filter, commits));
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.PersonIdent

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.