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

Function parse_from_commit

builtin/fast-import.c:2617–2626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2615}
2616
2617static void parse_from_commit(struct branch *b, char *buf, unsigned long size)
2618{
2619 if (!buf || size < the_hash_algo->hexsz + 6)
2620 die(_("not a valid commit: %s"), oid_to_hex(&b->oid));
2621 if (memcmp("tree ", buf, 5)
2622 || get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))
2623 die(_("the commit %s is corrupt"), oid_to_hex(&b->oid));
2624 oidcpy(&b->branch_tree.versions[0].oid,
2625 &b->branch_tree.versions[1].oid);
2626}
2627
2628static void parse_from_existing(struct branch *b)
2629{

Callers 2

parse_from_existingFunction · 0.85
parse_objectishFunction · 0.85

Calls 4

oid_to_hexFunction · 0.85
get_oid_hexFunction · 0.85
oidcpyFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected