Package org.eclipse.jgit.patch

Examples of org.eclipse.jgit.patch.HunkHeader


        return true;
    return false;
  }

  private boolean isNoNewlineAtEndOfFile(FileHeader fh) {
    HunkHeader lastHunk = fh.getHunks().get(fh.getHunks().size() - 1);
    RawText lhrt = new RawText(lastHunk.getBuffer());
    return lhrt.getString(lhrt.size() - 1).equals(
        "\\ No newline at end of file"); //$NON-NLS-1$
  }
View Full Code Here


    assertEquals(fh.getBuffer().length, fh.getEndOffset());
    assertEquals(FileHeader.PatchType.UNIFIED, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(1, hh.toEditList().size());

    EditList el = hh.toEditList();
    assertEquals(1, el.size());

    Edit e = el.get(0);
    assertEquals(0, e.getBeginA());
    assertEquals(0, e.getEndA());
View Full Code Here

    assertEquals(fh.getBuffer().length, fh.getEndOffset());
    assertEquals(FileHeader.PatchType.UNIFIED, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(1, hh.toEditList().size());

    EditList el = hh.toEditList();
    assertEquals(1, el.size());

    Edit e = el.get(0);
    assertEquals(0, e.getBeginA());
    assertEquals(2, e.getEndA());
View Full Code Here

    assertEquals(fh.getBuffer().length, fh.getEndOffset());
    assertEquals(FileHeader.PatchType.UNIFIED, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(1, hh.toEditList().size());

    EditList el = hh.toEditList();
    assertEquals(1, el.size());

    Edit e = el.get(0);
    assertEquals(1, e.getBeginA());
    assertEquals(1, e.getEndA());
View Full Code Here

    assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer()));
    assertEquals(FileHeader.PatchType.BINARY, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(0, hh.toEditList().size());
  }
View Full Code Here

    assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer()));

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(0, hh.toEditList().size());
  }
View Full Code Here

    assertEquals(fh.getBuffer().length, fh.getEndOffset());
    assertEquals(FileHeader.PatchType.UNIFIED, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(1, hh.toEditList().size());

    EditList el = hh.toEditList();
    assertEquals(1, el.size());

    Edit e = el.get(0);
    assertEquals(1, e.getBeginA());
    assertEquals(1, e.getEndA());
View Full Code Here

    assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer()));
    assertEquals(FileHeader.PatchType.BINARY, fh.getPatchType());

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(0, hh.toEditList().size());
  }
View Full Code Here

    assertEquals(diffHeader, RawParseUtils.decode(fh.getBuffer()));

    assertEquals(1, fh.getHunks().size());

    HunkHeader hh = fh.getHunks().get(0);
    assertEquals(0, hh.toEditList().size());
  }
View Full Code Here

        return true;
    return false;
  }

  private boolean isNoNewlineAtEndOfFile(FileHeader fh) {
    HunkHeader lastHunk = fh.getHunks().get(fh.getHunks().size() - 1);
    RawText lhrt = new RawText(lastHunk.getBuffer());
    return lhrt.getString(lhrt.size() - 1).equals(
        "\\ No newline at end of file"); //$NON-NLS-1$
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.patch.HunkHeader

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.