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

Function reftable_record_init

reftable/record.c:1306–1322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1304}
1305
1306int reftable_record_init(struct reftable_record *rec, uint8_t typ)
1307{
1308 memset(rec, 0, sizeof(*rec));
1309 rec->type = typ;
1310
1311 switch (typ) {
1312 case REFTABLE_BLOCK_TYPE_REF:
1313 case REFTABLE_BLOCK_TYPE_LOG:
1314 case REFTABLE_BLOCK_TYPE_OBJ:
1315 return 0;
1316 case REFTABLE_BLOCK_TYPE_INDEX:
1317 reftable_buf_init(&rec->u.idx.last_key);
1318 return 0;
1319 default:
1320 return REFTABLE_API_ERROR;
1321 }
1322}

Callers 7

t_copyFunction · 0.85
test_reftable_pq__recordFunction · 0.85
test_reftable_pq__indexFunction · 0.85
merged_table_init_iterFunction · 0.85
block_iter_seek_keyFunction · 0.85
table_iter_seek_linearFunction · 0.85

Calls 1

reftable_buf_initFunction · 0.85

Tested by 3

test_reftable_pq__recordFunction · 0.68
test_reftable_pq__indexFunction · 0.68