diff options
Diffstat (limited to 'notes-utils.c')
-rw-r--r-- | notes-utils.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/notes-utils.c b/notes-utils.c index d7d18e30f5..6197a5a455 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -1,9 +1,11 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "commit.h" +#include "environment.h" +#include "gettext.h" #include "refs.h" #include "notes-utils.h" -#include "repository.h" +#include "strbuf.h" void create_notes_commit(struct repository *r, struct notes_tree *t, @@ -23,7 +25,7 @@ void create_notes_commit(struct repository *r, struct object_id parent_oid; if (!read_ref(t->ref, &parent_oid)) { struct commit *parent = lookup_commit(r, &parent_oid); - if (parse_commit(parent)) + if (repo_parse_commit(r, parent)) die("Failed to find/parse commit %s", t->ref); commit_list_insert(parent, &parents); } @@ -91,7 +93,9 @@ static combine_notes_fn parse_combine_notes_fn(const char *v) return NULL; } -static int notes_rewrite_config(const char *k, const char *v, void *cb) +static int notes_rewrite_config(const char *k, const char *v, + const struct config_context *ctx UNUSED, + void *cb) { struct notes_rewrite_cfg *c = cb; if (starts_with(k, "notes.rewrite.") && !strcmp(k+14, c->cmd)) { @@ -107,6 +111,8 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb) } return 0; } else if (!c->refs_from_env && !strcmp(k, "notes.rewriteref")) { + if (!v) + return config_error_nonbool(k); /* note that a refs/ prefix is implied in the * underlying for_each_glob_ref */ if (starts_with(v, "refs/notes/")) |