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

Function wt_status_locate_end

wt-status.c:1124–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1122}
1123
1124size_t wt_status_locate_end(const char *s, size_t len)
1125{
1126 const char *p;
1127 struct strbuf pattern = STRBUF_INIT;
1128
1129 strbuf_addf(&pattern, "\n%s %s", comment_line_str, cut_line);
1130 if (starts_with(s, pattern.buf + 1))
1131 len = 0;
1132 else if ((p = strstr(s, pattern.buf))) {
1133 size_t newlen = p - s + 1;
1134 if (newlen < len)
1135 len = newlen;
1136 }
1137 strbuf_release(&pattern);
1138 return len;
1139}
1140
1141void wt_status_append_cut_line(struct strbuf *buf)
1142{

Callers 3

cleanup_messageFunction · 0.85
prepare_to_commitFunction · 0.85

Calls 3

strbuf_addfFunction · 0.85
starts_withFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected