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

Function notes_cache_write

notes-cache.c:57–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57int notes_cache_write(struct notes_cache *c)
58{
59 struct object_id tree_oid, commit_oid;
60
61 if (!c || !c->tree.initialized || !c->tree.update_ref ||
62 !*c->tree.update_ref)
63 return -1;
64 if (!c->tree.dirty)
65 return 0;
66
67 if (write_notes_tree(&c->tree, &tree_oid))
68 return -1;
69 if (commit_tree(c->validity, strlen(c->validity), &tree_oid, NULL,
70 &commit_oid, NULL, NULL) < 0)
71 return -1;
72 if (refs_update_ref(get_main_ref_store(the_repository), "update notes cache", c->tree.update_ref, &commit_oid,
73 NULL, 0, UPDATE_REFS_QUIET_ON_ERR) < 0)
74 return -1;
75
76 return 0;
77}
78
79char *notes_cache_get(struct notes_cache *c, struct object_id *key_oid,
80 size_t *outsize)

Callers 1

fill_textconvFunction · 0.85

Calls 4

write_notes_treeFunction · 0.85
commit_treeFunction · 0.85
refs_update_refFunction · 0.85
get_main_ref_storeFunction · 0.85

Tested by

no test coverage detected