summaryrefslogtreecommitdiffstats
path: root/builtin/fmt-merge-msg.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-06-29 03:21:51 +0200
committerJunio C Hamano <gitster@pobox.com>2018-06-29 19:43:38 +0200
commit109cd76dd3467bd05f8d2145b857006649741d5c (patch)
tree3b3baf8fb9861083f665e91e77e5ee07ec504747 /builtin/fmt-merge-msg.c
parentMerge branch 'sb/object-store-grafts' into sb/object-store-lookup (diff)
downloadgit-109cd76dd3467bd05f8d2145b857006649741d5c.tar.xz
git-109cd76dd3467bd05f8d2145b857006649741d5c.zip
object: add repository argument to parse_object
Add a repository argument to allow the callers of parse_object to be more specific about which repository to act on. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fmt-merge-msg.c')
-rw-r--r--builtin/fmt-merge-msg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 1b526adb3a..5e44589b54 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -11,6 +11,7 @@
#include "branch.h"
#include "fmt-merge-msg.h"
#include "gpg-interface.h"
+#include "repository.h"
static const char * const fmt_merge_msg_usage[] = {
N_("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"),
@@ -343,7 +344,8 @@ static void shortlog(const char *name,
const struct object_id *oid = &origin_data->oid;
int limit = opts->shortlog_len;
- branch = deref_tag(parse_object(oid), oid_to_hex(oid), GIT_SHA1_HEXSZ);
+ branch = deref_tag(parse_object(the_repository, oid), oid_to_hex(oid),
+ GIT_SHA1_HEXSZ);
if (!branch || branch->type != OBJ_COMMIT)
return;
@@ -563,7 +565,7 @@ static void find_merge_parents(struct merge_parents *result,
* "name" here and we do not want to contaminate its
* util field yet.
*/
- obj = parse_object(&oid);
+ obj = parse_object(the_repository, &oid);
parent = (struct commit *)peel_to_type(NULL, 0, obj, OBJ_COMMIT);
if (!parent)
continue;