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

Function write_reflog_existence_table

refs/reftable-backend.c:2306–2336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2304};
2305
2306static int write_reflog_existence_table(struct reftable_writer *writer,
2307 void *cb_data)
2308{
2309 struct write_reflog_existence_arg *arg = cb_data;
2310 uint64_t ts = reftable_stack_next_update_index(arg->stack);
2311 struct reftable_log_record log = {0};
2312 int ret;
2313
2314 ret = reftable_stack_read_log(arg->stack, arg->refname, &log);
2315 if (ret <= 0)
2316 goto done;
2317
2318 ret = reftable_writer_set_limits(writer, ts, ts);
2319 if (ret < 0)
2320 goto done;
2321
2322 /*
2323 * The existence entry has both old and new object ID set to the
2324 * null object ID. Our iterators are aware of this and will not present
2325 * them to their callers.
2326 */
2327 log.refname = xstrdup(arg->refname);
2328 log.update_index = ts;
2329 log.value_type = REFTABLE_LOG_UPDATE;
2330 ret = reftable_writer_add_log(writer, &log);
2331
2332done:
2333 assert(ret != REFTABLE_API_ERROR);
2334 reftable_log_record_release(&log);
2335 return ret;
2336}
2337
2338static int reftable_be_create_reflog(struct ref_store *ref_store,
2339 const char *refname,

Callers

nothing calls this directly

Calls 6

reftable_stack_read_logFunction · 0.85
xstrdupFunction · 0.85
reftable_writer_add_logFunction · 0.85

Tested by

no test coverage detected