MCPcopy Index your code
hub / github.com/git/git / remove_maybe_stale_table

Function remove_maybe_stale_table

reftable/stack.c:1749–1778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1747}
1748
1749static void remove_maybe_stale_table(struct reftable_stack *st, uint64_t max,
1750 const char *name)
1751{
1752 int err = 0;
1753 uint64_t update_idx = 0;
1754 struct reftable_block_source src = { NULL };
1755 struct reftable_table *table = NULL;
1756 struct reftable_buf table_path = REFTABLE_BUF_INIT;
1757
1758 err = stack_filename(&table_path, st, name);
1759 if (err < 0)
1760 goto done;
1761
1762 err = reftable_block_source_from_file(&src, table_path.buf);
1763 if (err < 0)
1764 goto done;
1765
1766 err = reftable_table_new(&table, &src, name);
1767 if (err < 0)
1768 goto done;
1769
1770 update_idx = reftable_table_max_update_index(table);
1771 reftable_table_decref(table);
1772
1773 if (update_idx <= max) {
1774 unlink(table_path.buf);
1775 }
1776done:
1777 reftable_buf_release(&table_path);
1778}
1779
1780static int reftable_stack_clean_locked(struct reftable_stack *st)
1781{

Callers 1

Calls 6

stack_filenameFunction · 0.85
reftable_table_newFunction · 0.85
reftable_table_decrefFunction · 0.85
reftable_buf_releaseFunction · 0.85

Tested by

no test coverage detected