Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectId.abbreviate()


            RepositoryBuilder builder = new RepositoryBuilder();
            Repository repository = builder.findGitDir(baseDir).readEnvironment().build();
            ObjectId objectId = repository.resolve(Constants.HEAD);
            if (objectId != null) {
                transformer.setParameter("repository.commit", objectId.getName());
                transformer.setParameter("repository.commit.short", objectId.abbreviate(abbrevLen).name());
                return true;
            } else {
                log.warn("Could not determine current repository commit hash.");
                return false;
            }
View Full Code Here


        outw.print(CLIText.get().nothingToSquash);
      outw.println(CLIText.get().alreadyUpToDate);
      break;
    case FAST_FORWARD:
      ObjectId oldHeadId = oldHead.getObjectId();
      outw.println(MessageFormat.format(CLIText.get().updating, oldHeadId
          .abbreviate(7).name(), result.getNewHead().abbreviate(7)
          .name()));
      outw.println(result.getMergeStatus().toString());
      break;
    case CHECKOUT_CONFLICT:
View Full Code Here

        outw.print(CLIText.get().nothingToSquash);
      outw.println(CLIText.get().alreadyUpToDate);
      break;
    case FAST_FORWARD:
      ObjectId oldHeadId = oldHead.getObjectId();
      outw.println(MessageFormat.format(CLIText.get().updating, oldHeadId
          .abbreviate(7).name(), result.getNewHead().abbreviate(7)
          .name()));
      outw.println(result.getMergeStatus().toString());
      break;
    case CHECKOUT_CONFLICT:
View Full Code Here

  @Test
  public void testAbbreviateOnEmptyRepository() throws IOException {
    ObjectId id = id("9d5b926ed164e8ee88d3b8b1e525d699adda01ba");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));
View Full Code Here

  @Test
  public void testAbbreviateOnEmptyRepository() throws IOException {
    ObjectId id = id("9d5b926ed164e8ee88d3b8b1e525d699adda01ba");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));

    assertEquals(AbbreviatedObjectId.fromObjectId(id), //
View Full Code Here

  public void testAbbreviateOnEmptyRepository() throws IOException {
    ObjectId id = id("9d5b926ed164e8ee88d3b8b1e525d699adda01ba");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));

    assertEquals(AbbreviatedObjectId.fromObjectId(id), //
        reader.abbreviate(id, OBJECT_ID_STRING_LENGTH));
View Full Code Here

    ObjectId id = id("9d5b926ed164e8ee88d3b8b1e525d699adda01ba");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));

    assertEquals(AbbreviatedObjectId.fromObjectId(id), //
        reader.abbreviate(id, OBJECT_ID_STRING_LENGTH));
View Full Code Here

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));

    assertEquals(AbbreviatedObjectId.fromObjectId(id), //
        reader.abbreviate(id, OBJECT_ID_STRING_LENGTH));

    Collection<ObjectId> matches;
View Full Code Here

  @Test
  public void testAbbreviateLooseBlob() throws Exception {
    ObjectId id = test.blob("test");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));
View Full Code Here

  @Test
  public void testAbbreviateLooseBlob() throws Exception {
    ObjectId id = test.blob("test");

    assertEquals(id.abbreviate(2), reader.abbreviate(id, 2));
    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));
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.