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

Function migrate_one_reflog_entry

refs.c:3211–3239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3209}
3210
3211static int migrate_one_reflog_entry(const char *refname,
3212 struct object_id *old_oid,
3213 struct object_id *new_oid,
3214 const char *committer,
3215 timestamp_t timestamp, int tz,
3216 const char *msg, void *cb_data)
3217{
3218 struct migration_data *data = cb_data;
3219 struct ident_split ident;
3220 const char *date;
3221 int ret;
3222
3223 if (split_ident_line(&ident, committer, strlen(committer)) < 0)
3224 return -1;
3225
3226 strbuf_reset(&data->name);
3227 strbuf_add(&data->name, ident.name_begin, ident.name_end - ident.name_begin);
3228 strbuf_reset(&data->mail);
3229 strbuf_add(&data->mail, ident.mail_begin, ident.mail_end - ident.mail_begin);
3230
3231 date = show_date(timestamp, tz, DATE_MODE(NORMAL));
3232 strbuf_reset(&data->sb);
3233 strbuf_addstr(&data->sb, fmt_ident(data->name.buf, data->mail.buf, WANT_BLANK_IDENT, date, 0));
3234
3235 ret = ref_transaction_update_reflog(data->transaction, refname,
3236 new_oid, old_oid, data->sb.buf,
3237 msg, data->index++, data->errbuf);
3238 return ret;
3239}
3240
3241static int migrate_one_reflog(const char *refname, void *cb_data)
3242{

Callers

nothing calls this directly

Calls 6

split_ident_lineFunction · 0.85
strbuf_addFunction · 0.85
show_dateFunction · 0.85
strbuf_addstrFunction · 0.85
fmt_identFunction · 0.85

Tested by

no test coverage detected