Examples of abbreviate()


Examples of org.eclipse.jgit.revwalk.RevBlob.abbreviate()

    assertTrue(reader.has(id));

    assertEquals(id.abbreviate(7), reader.abbreviate(id, 7));
    assertEquals(id.abbreviate(8), reader.abbreviate(id, 8));
    assertEquals(id.abbreviate(10), reader.abbreviate(id, 10));
    assertEquals(id.abbreviate(16), reader.abbreviate(id, 16));

    Collection<ObjectId> matches = reader.resolve(reader.abbreviate(id, 8));
    assertNotNull(matches);
    assertEquals(1, matches.size());
    assertEquals(id, matches.iterator().next());
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevCommit.abbreviate()

        String oursName = String.format("HEAD   (%s %s)",
            ours.abbreviate(6).name(),
            oursMsg.substring(0, Math.min(oursMsg.length(), 60)));
        String theirsName = String.format("BRANCH (%s %s)",
            theirs.abbreviate(6).name(),
            theirsMsg.substring(0, Math.min(theirsMsg.length(), 60)));

        MergeFormatter fmt = new MergeFormatter();
        Map<String, MergeResult<? extends Sequence>> r = m.getMergeResults();
        Map<String, ObjectId> resolved = new HashMap<String, ObjectId>();
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevCommit.abbreviate()

        // Commit index changes
        CommitBuilder builder = createBuilder();
        builder.setParentId(headCommit);
        builder.setTreeId(cache.writeTree(inserter));
        builder.setMessage(MessageFormat.format(indexMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        ObjectId indexCommit = inserter.insert(builder);

        // Commit untracked changes
        ObjectId untrackedCommit = null;
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevCommit.abbreviate()

          untrackedBuilder.finish();

          builder.setParentIds(new ObjectId[0]);
          builder.setTreeId(untrackedDirCache.writeTree(inserter));
          builder.setMessage(MessageFormat.format(MSG_UNTRACKED,
              branch, headCommit.abbreviate(7).name(),
              headCommit.getShortMessage()));
          untrackedCommit = inserter.insert(builder);
        }

        // Commit working tree changes
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevCommit.abbreviate()

        builder.addParentId(indexCommit);
        if (untrackedCommit != null)
          builder.addParentId(untrackedCommit);
        builder.setMessage(MessageFormat.format(
            workingDirectoryMessage, branch,
            headCommit.abbreviate(7).name(),
            headCommit.getShortMessage()));
        builder.setTreeId(cache.writeTree(inserter));
        commitId = inserter.insert(builder);
        inserter.flush();
View Full Code Here

Examples of org.slf4j.migrator.helper.Abbreviator.abbreviate()

  }

  public void testSmoke() {
    {
      Abbreviator abb = new Abbreviator(2, 100, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals(INPUT_0, r);
    }

    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
View Full Code Here

Examples of org.slf4j.migrator.helper.Abbreviator.abbreviate()

      assertEquals(INPUT_0, r);
    }

    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals("/abc/.../ABC", r);
    }
    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
      String r = abb.abbreviate(INPUT_0);
View Full Code Here

Examples of org.slf4j.migrator.helper.Abbreviator.abbreviate()

      String r = abb.abbreviate(INPUT_0);
      assertEquals("/abc/.../ABC", r);
    }
    {
      Abbreviator abb = new Abbreviator(3, 8, FS);
      String r = abb.abbreviate(INPUT_0);
      assertEquals("/abc/.../ABC", r);
    }
  }

  public void testImpossibleToAbbreviate() {
View Full Code Here

Examples of org.slf4j.migrator.helper.Abbreviator.abbreviate()

  }

  public void testImpossibleToAbbreviate() {
    Abbreviator abb = new Abbreviator(2, 20, FS);
    String in = "iczldqwivpgm/mgrmvbjdxrwmqgprdjusth";
    String r = abb.abbreviate(in);
    assertEquals(in, r);
  }

  public void testNoFS() {
    Abbreviator abb = new Abbreviator(2, 100, FS);
View Full Code Here

Examples of org.slf4j.migrator.helper.Abbreviator.abbreviate()

    assertEquals(in, r);
  }

  public void testNoFS() {
    Abbreviator abb = new Abbreviator(2, 100, FS);
    String r = abb.abbreviate("hello");
    assertEquals("hello", r);

  }

  public void testZeroPrefix() {
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.