MCPcopy Index your code
hub / github.com/git/git / find_next_line

Function find_next_line

add-patch.c:777–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775}
776
777static size_t find_next_line(struct strbuf *sb, size_t offset)
778{
779 char *eol;
780
781 if (offset >= sb->len)
782 BUG("looking for next line beyond buffer (%d >= %d)\n%s",
783 (int)offset, (int)sb->len, sb->buf);
784
785 eol = memchr(sb->buf + offset, '\n', sb->len - offset);
786 if (!eol)
787 return sb->len;
788 return eol - sb->buf + 1;
789}
790
791static void render_hunk(struct add_p_state *s, struct hunk *hunk,
792 ssize_t delta, int colored, struct strbuf *out)

Callers 5

merge_hunksFunction · 0.85
split_hunkFunction · 0.85
edit_hunk_manuallyFunction · 0.85
recount_edited_hunkFunction · 0.85
summarize_hunkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected