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

Function reftable_index_record_decode

reftable/record.c:1094–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092}
1093
1094static int reftable_index_record_decode(void *rec, struct reftable_buf key,
1095 uint8_t val_type REFTABLE_UNUSED,
1096 struct string_view in,
1097 uint32_t hash_size REFTABLE_UNUSED,
1098 struct reftable_buf *scratch REFTABLE_UNUSED)
1099{
1100 struct string_view start = in;
1101 struct reftable_index_record *r = rec;
1102 int err, n = 0;
1103
1104 reftable_buf_reset(&r->last_key);
1105 err = reftable_buf_add(&r->last_key, key.buf, key.len);
1106 if (err < 0)
1107 return err;
1108
1109 n = get_var_int(&r->offset, &in);
1110 if (n < 0)
1111 return n;
1112
1113 string_view_consume(&in, n);
1114 return start.len - in.len;
1115}
1116
1117static int reftable_index_record_equal(const void *a, const void *b,
1118 uint32_t hash_size REFTABLE_UNUSED)

Callers

nothing calls this directly

Calls 4

reftable_buf_resetFunction · 0.85
reftable_buf_addFunction · 0.85
get_var_intFunction · 0.85
string_view_consumeFunction · 0.85

Tested by

no test coverage detected