MCPcopy Create free account
hub / github.com/git/git / find_end_of_log_message

Function find_end_of_log_message

trailer.c:858–880  ·  view source on GitHub ↗

* Find the end of the log message as an offset from the start of the input * (where callers of this function are interested in looking for a trailers * block in the same input). We have to consider two categories of content that * can come at the end of the input which we want to ignore (because they don't * belong in the log message): * * (1) the "patch part" which begins with a "---" divid

Source from the content-addressed store, hash-verified

856 * contains a trailer block, but that's not the concern of this function.
857 */
858static size_t find_end_of_log_message(const char *input, int no_divider)
859{
860 size_t end;
861 const char *s;
862
863 /* Assume the naive end of the input is already what we want. */
864 end = strlen(input);
865
866 /* Optionally skip over any patch part ("---" line and below). */
867 if (!no_divider) {
868 for (s = input; *s; s = next_line(s)) {
869 const char *v;
870
871 if (skip_prefix(s, "---", &v) && isspace(*v)) {
872 end = s - input;
873 break;
874 }
875 }
876 }
877
878 /* Skip over other ignorable bits. */
879 return end - ignored_log_message_bytes(input, end);
880}
881
882/*
883 * Return the position of the first trailer line or len if there are no

Callers 1

trailer_block_getFunction · 0.85

Calls 2

next_lineFunction · 0.70

Tested by

no test coverage detected