Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.MutableObjectId


    int maxN = 0;

    AbbreviatedObjectId startId;
    ObjectReader or = db.newObjectReader();
    try {
      final MutableObjectId id = new MutableObjectId();
      RevWalk rw = new RevWalk(or);
      TreeWalk tw = new TreeWalk(or);
      tw.setFilter(TreeFilter.ANY_DIFF);
      tw.setRecursive(true);
View Full Code Here


    long fileCnt = 0;
    long lineCnt = 0;
    ObjectReader or = db.newObjectReader();
    try {
      final MutableObjectId id = new MutableObjectId();
      RevWalk rw = new RevWalk(or);
      TreeWalk tw = new TreeWalk(or);
      tw.reset(rw.parseTree(db.resolve(Constants.HEAD)));
      tw.setRecursive(true);
View Full Code Here

      treeFilterMarker = new TreeFilterMarker(markTreeFilters);
    else
      treeFilterMarker = null;

    List<DiffEntry> r = new ArrayList<DiffEntry>();
    MutableObjectId idBuf = new MutableObjectId();
    while (walk.next()) {
      DiffEntry entry = new DiffEntry();

      walk.getObjectId(idBuf, 0);
      entry.oldId = AbbreviatedObjectId.fromObjectId(idBuf);
View Full Code Here

  }

  private RevWalk(final Repository repo, final ObjectReader or) {
    repository = repo;
    reader = or;
    idBuffer = new MutableObjectId();
    objects = new ObjectIdSubclassMap<RevObject>();
    roots = new ArrayList<RevCommit>();
    queue = new DateRevQueue();
    pending = new StartGenerator(this);
    sorting = EnumSet.of(RevSort.NONE);
View Full Code Here

  // readACK

  public void testReadACK_NAK() throws IOException {
    final ObjectId expid = ObjectId
        .fromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e");
    final MutableObjectId actid = new MutableObjectId();
    actid.fromString(expid.name());

    init("0008NAK\n");
    assertSame(PacketLineIn.AckNackResult.NAK, in.readACK(actid));
    assertTrue(actid.equals(expid));
    assertEOF();
  }
View Full Code Here

  }

  public void testReadACK_ACK1() throws IOException {
    final ObjectId expid = ObjectId
        .fromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e");
    final MutableObjectId actid = new MutableObjectId();

    init("0031ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e\n");
    assertSame(PacketLineIn.AckNackResult.ACK, in.readACK(actid));
    assertTrue(actid.equals(expid));
    assertEOF();
  }
View Full Code Here

  }

  public void testReadACK_ACKcontinue1() throws IOException {
    final ObjectId expid = ObjectId
        .fromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e");
    final MutableObjectId actid = new MutableObjectId();

    init("003aACK fcfcfb1fd94829c1a1704f894fc111d14770d34e continue\n");
    assertSame(PacketLineIn.AckNackResult.ACK_CONTINUE, in.readACK(actid));
    assertTrue(actid.equals(expid));
    assertEOF();
  }
View Full Code Here

  }

  public void testReadACK_ACKcommon1() throws IOException {
    final ObjectId expid = ObjectId
        .fromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e");
    final MutableObjectId actid = new MutableObjectId();

    init("0038ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e common\n");
    assertSame(PacketLineIn.AckNackResult.ACK_COMMON, in.readACK(actid));
    assertTrue(actid.equals(expid));
    assertEOF();
  }
View Full Code Here

  }

  public void testReadACK_ACKready1() throws IOException {
    final ObjectId expid = ObjectId
        .fromString("fcfcfb1fd94829c1a1704f894fc111d14770d34e");
    final MutableObjectId actid = new MutableObjectId();

    init("0037ACK fcfcfb1fd94829c1a1704f894fc111d14770d34e ready\n");
    assertSame(PacketLineIn.AckNackResult.ACK_READY, in.readACK(actid));
    assertTrue(actid.equals(expid));
    assertEOF();
  }
View Full Code Here

  }

  public void testReadACK_Invalid1() {
    init("HELO");
    try {
      in.readACK(new MutableObjectId());
      fail("incorrectly accepted invalid packet header");
    } catch (IOException e) {
      assertEquals("Invalid packet line header: HELO", e.getMessage());
    }
  }
View Full Code Here

TOP

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

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.