diff options
Diffstat (limited to 'fmt-merge-msg.c')
-rw-r--r-- | fmt-merge-msg.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c index f48f44f9cd..5af0d4715b 100644 --- a/fmt-merge-msg.c +++ b/fmt-merge-msg.c @@ -1,8 +1,13 @@ +#include "git-compat-util.h" +#include "alloc.h" #include "config.h" +#include "environment.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "diff.h" #include "diff-merges.h" +#include "hex.h" #include "revision.h" #include "tag.h" #include "string-list.h" @@ -17,8 +22,6 @@ static struct string_list suppress_dest_patterns = STRING_LIST_INIT_DUP; int fmt_merge_msg_config(const char *key, const char *value, void *cb) { - int status = 0; - if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) { int is_bool; merge_log_config = git_config_bool_or_int(key, value, &is_bool); @@ -37,9 +40,6 @@ int fmt_merge_msg_config(const char *key, const char *value, void *cb) string_list_append(&suppress_dest_patterns, value); suppress_dest_pattern_seen = 1; } else { - status = git_gpg_config(key, value, NULL); - if (status) - return status; return git_default_config(key, value, cb); } return 0; @@ -271,9 +271,10 @@ static void record_person_from_buf(int which, struct string_list *people, static void record_person(int which, struct string_list *people, struct commit *commit) { - const char *buffer = get_commit_buffer(commit, NULL); + const char *buffer = repo_get_commit_buffer(the_repository, commit, + NULL); record_person_from_buf(which, people, buffer); - unuse_commit_buffer(commit, buffer); + repo_unuse_commit_buffer(the_repository, commit, buffer); } static int cmp_string_list_util_as_integral(const void *a_, const void *b_) @@ -384,7 +385,8 @@ static void shortlog(const char *name, if (subjects.nr > limit) continue; - format_commit_message(commit, "%s", &sb, &ctx); + repo_format_commit_message(the_repository, commit, "%s", &sb, + &ctx); strbuf_ltrim(&sb); if (!sb.len) @@ -519,7 +521,8 @@ static void fmt_merge_msg_sigs(struct strbuf *out) struct object_id *oid = origins.items[i].util; enum object_type type; unsigned long size; - char *buf = read_object_file(oid, &type, &size); + char *buf = repo_read_object_file(the_repository, oid, &type, + &size); char *origbuf = buf; unsigned long len = size; struct signature_check sigc = { NULL }; @@ -605,7 +608,9 @@ static void find_merge_parents(struct merge_parents *result, * util field yet. */ obj = parse_object(the_repository, &oid); - parent = (struct commit *)peel_to_type(NULL, 0, obj, OBJ_COMMIT); + parent = (struct commit *)repo_peel_to_type(the_repository, + NULL, 0, obj, + OBJ_COMMIT); if (!parent) continue; commit_list_insert(parent, &parents); |