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

Function write_author_script

builtin/am.c:339–358  ·  view source on GitHub ↗

* Saves state->author_name, state->author_email and state->author_date in the * state directory's "author-script" file. */

Source from the content-addressed store, hash-verified

337 * state directory's "author-script" file.
338 */
339static void write_author_script(const struct am_state *state)
340{
341 struct strbuf sb = STRBUF_INIT;
342
343 strbuf_addstr(&sb, "GIT_AUTHOR_NAME=");
344 sq_quote_buf(&sb, state->author_name);
345 strbuf_addch(&sb, '\n');
346
347 strbuf_addstr(&sb, "GIT_AUTHOR_EMAIL=");
348 sq_quote_buf(&sb, state->author_email);
349 strbuf_addch(&sb, '\n');
350
351 strbuf_addstr(&sb, "GIT_AUTHOR_DATE=");
352 sq_quote_buf(&sb, state->author_date);
353 strbuf_addch(&sb, '\n');
354
355 write_state_text(state, "author-script", sb.buf);
356
357 strbuf_release(&sb);
358}
359
360/**
361 * Reads the commit message from the state directory's "final-commit" file,

Callers 1

am_runFunction · 0.70

Calls 5

strbuf_addstrFunction · 0.85
sq_quote_bufFunction · 0.85
strbuf_addchFunction · 0.85
write_state_textFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected