| 39 | } |
| 40 | |
| 41 | void notes_cache_init(struct repository *r, struct notes_cache *c, |
| 42 | const char *name, const char *validity) |
| 43 | { |
| 44 | struct strbuf ref = STRBUF_INIT; |
| 45 | int flags = NOTES_INIT_WRITABLE; |
| 46 | |
| 47 | memset(c, 0, sizeof(*c)); |
| 48 | c->validity = xstrdup(validity); |
| 49 | |
| 50 | strbuf_addf(&ref, "refs/notes/%s", name); |
| 51 | if (!notes_cache_match_validity(r, ref.buf, validity)) |
| 52 | flags |= NOTES_INIT_EMPTY; |
| 53 | init_notes(&c->tree, ref.buf, combine_notes_overwrite, flags); |
| 54 | strbuf_release(&ref); |
| 55 | } |
| 56 | |
| 57 | int notes_cache_write(struct notes_cache *c) |
| 58 | { |
no test coverage detected