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

Function should_write_log

refs/reftable-backend.c:287–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287static int should_write_log(struct reftable_ref_store *refs, const char *refname)
288{
289 enum log_refs_config log_refs_cfg = refs->log_all_ref_updates;
290 if (log_refs_cfg == LOG_REFS_UNSET)
291 log_refs_cfg = is_bare_repository() ? LOG_REFS_NONE : LOG_REFS_NORMAL;
292
293 switch (log_refs_cfg) {
294 case LOG_REFS_NONE:
295 return refs_reflog_exists(&refs->base, refname);
296 case LOG_REFS_ALWAYS:
297 return 1;
298 case LOG_REFS_NORMAL:
299 if (should_autocreate_reflog(log_refs_cfg, refname))
300 return 1;
301 return refs_reflog_exists(&refs->base, refname);
302 default:
303 BUG("unhandled core.logAllRefUpdates value %d", log_refs_cfg);
304 }
305}
306
307static void fill_reftable_log_record(struct reftable_log_record *log, const struct ident_split *split)
308{

Callers 1

write_transaction_tableFunction · 0.85

Calls 3

is_bare_repositoryFunction · 0.85
refs_reflog_existsFunction · 0.85
should_autocreate_reflogFunction · 0.85

Tested by

no test coverage detected