| 285 | } |
| 286 | |
| 287 | static 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 | |
| 307 | static void fill_reftable_log_record(struct reftable_log_record *log, const struct ident_split *split) |
| 308 | { |
no test coverage detected