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

Function set_commit_buffer_from_strbuf

blame.c:175–182  ·  view source on GitHub ↗

* This isn't as simple as passing sb->buf and sb->len, because we * want to transfer ownership of the buffer to the commit (so we * must use detach). */

Source from the content-addressed store, hash-verified

173 * must use detach).
174 */
175static void set_commit_buffer_from_strbuf(struct repository *r,
176 struct commit *c,
177 struct strbuf *sb)
178{
179 size_t len;
180 void *buf = strbuf_detach(sb, &len);
181 set_commit_buffer(r, c, buf, len);
182}
183
184/*
185 * Prepare a dummy commit that represents the work tree (or staged) item.

Callers 1

fake_working_tree_commitFunction · 0.85

Calls 2

strbuf_detachFunction · 0.85
set_commit_bufferFunction · 0.85

Tested by

no test coverage detected