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

Function read_trailers

sequencer.c:3168–3193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3166}
3167
3168static int read_trailers(struct replay_opts *opts, struct strbuf *buf)
3169{
3170 ssize_t len;
3171
3172 strbuf_reset(buf);
3173 len = strbuf_read_file(buf, rebase_path_trailer(), 0);
3174 if (len > 0) {
3175 char *p = buf->buf, *nl;
3176
3177 trailer_config_init();
3178
3179 while ((nl = strchr(p, '\n'))) {
3180 *nl = '\0';
3181 if (!*p)
3182 return error(_("trailers file contains empty line"));
3183 strvec_push(&opts->trailer_args, p);
3184 p = nl + 1;
3185 }
3186 } else if (!len) {
3187 return error(_("trailers file is empty"));
3188 } else if (errno != ENOENT) {
3189 return error(_("cannot read trailers files"));
3190 }
3191
3192 return 0;
3193}
3194
3195static int read_populate_opts(struct replay_opts *opts)
3196{

Callers 1

read_populate_optsFunction · 0.85

Calls 4

strbuf_read_fileFunction · 0.85
trailer_config_initFunction · 0.85
errorFunction · 0.85
strvec_pushFunction · 0.85

Tested by

no test coverage detected