/** {@inheritDoc} */ @Override public List<ReflogEntry> getReverseEntries(int max) throws IOException { final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return Collections.emptyList(); } int rs = RawParseUtils.prevLF(log, log.length); List<ReflogEntry> ret = new ArrayList<>(); while (rs >= 0 && max-- > 0) { rs = RawParseUtils.prevLF(log, rs); ReflogEntry entry = new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); ret.add(entry); } return ret; } }
private static String readFile(File directory, String fileName) throws IOException { byte[] content = IO.readFully(new File(directory, fileName)); // strip off the last LF int end = RawParseUtils.prevLF(content, content.length); return RawParseUtils.decode(content, 0, end + 1); }
/** {@inheritDoc} */ @Override public ReflogEntry getReverseEntry(int number) throws IOException { if (number < 0) throw new IllegalArgumentException(); final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return null; } int rs = RawParseUtils.prevLF(log, log.length); int current = 0; while (rs >= 0) { rs = RawParseUtils.prevLF(log, rs); if (number == current) return new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); current++; } return null; }
final Charset enc = guessEncoding(); for (;;) { ptr = RawParseUtils.prevLF(raw, ptr); if (ptr <= msgB) break; // Don't parse commit headers as footer lines.
private static String readFile(File directory, String fileName) throws IOException { byte[] content = IO.readFully(new File(directory, fileName)); // strip off the last LF int end = RawParseUtils.prevLF(content, content.length); return RawParseUtils.decode(content, 0, end + 1); }
public List<ReflogEntry> getReverseEntries(int max) throws IOException { final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return Collections.emptyList(); } int rs = RawParseUtils.prevLF(log, log.length); List<ReflogEntry> ret = new ArrayList<ReflogEntry>(); while (rs >= 0 && max-- > 0) { rs = RawParseUtils.prevLF(log, rs); ReflogEntry entry = new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); ret.add(entry); } return ret; } }
public ReflogEntry getReverseEntry(int number) throws IOException { if (number < 0) throw new IllegalArgumentException(); final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return null; } int rs = RawParseUtils.prevLF(log, log.length); int current = 0; while (rs >= 0) { rs = RawParseUtils.prevLF(log, rs); if (number == current) return new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); current++; } return null; }
private static String readFile(File directory, String fileName) throws IOException { byte[] content = IO.readFully(new File(directory, fileName)); // strip off the last LF int end = RawParseUtils.prevLF(content, content.length); return RawParseUtils.decode(content, 0, end + 1); }
/** {@inheritDoc} */ @Override public List<ReflogEntry> getReverseEntries(int max) throws IOException { final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return Collections.emptyList(); } int rs = RawParseUtils.prevLF(log, log.length); List<ReflogEntry> ret = new ArrayList<>(); while (rs >= 0 && max-- > 0) { rs = RawParseUtils.prevLF(log, rs); ReflogEntry entry = new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); ret.add(entry); } return ret; } }
/** {@inheritDoc} */ @Override public ReflogEntry getReverseEntry(int number) throws IOException { if (number < 0) throw new IllegalArgumentException(); final byte[] log; try { log = IO.readFully(logName); } catch (FileNotFoundException e) { if (logName.exists()) { throw e; } return null; } int rs = RawParseUtils.prevLF(log, log.length); int current = 0; while (rs >= 0) { rs = RawParseUtils.prevLF(log, rs); if (number == current) return new ReflogEntryImpl(log, rs < 0 ? 0 : rs + 2); current++; } return null; }
final Charset enc = guessEncoding(); for (;;) { ptr = RawParseUtils.prevLF(raw, ptr); if (ptr <= msgB) break; // Don't parse commit headers as footer lines.
final Charset enc = guessEncoding(); for (;;) { ptr = RawParseUtils.prevLF(raw, ptr); if (ptr <= msgB) break; // Don't parse commit headers as footer lines.
final Charset enc = guessEncoding(); for (;;) { ptr = RawParseUtils.prevLF(raw, ptr); if (ptr <= msgB) break; // Don't parse commit headers as footer lines.