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

Function find_commit_header

commit.c:1925–1945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1923}
1924
1925const char *find_commit_header(const char *msg, const char *key, size_t *out_len)
1926{
1927 int key_len = strlen(key);
1928 const char *line = msg;
1929
1930 while (line) {
1931 const char *eol = strchrnul(line, '\n');
1932
1933 if (line == eol)
1934 return NULL;
1935
1936 if (eol - line > key_len &&
1937 !strncmp(line, key, key_len) &&
1938 line[key_len] == ' ') {
1939 *out_len = eol - line - key_len - 1;
1940 return line + key_len + 1;
1941 }
1942 line = *eol ? eol + 1 : NULL;
1943 }
1944 return NULL;
1945}
1946
1947/*
1948 * Inspect the given string and determine the true "end" of the log message, in

Callers 14

get_authorFunction · 0.85
get_headerFunction · 0.85
get_authorFunction · 0.85
record_author_dateFunction · 0.85
parse_payload_metadataFunction · 0.85
get_commit_infoFunction · 0.85
handle_commitFunction · 0.85
check_nonceFunction · 0.85
check_cert_push_optionsFunction · 0.85
do_import_stashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected