cache.h: add repository argument to oid_object_info_extended
Add a repository argument to allow oid_object_info_extended callers 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. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
90e777f1e2
commit
7ecd869060
@ -77,7 +77,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
||||
switch (opt) {
|
||||
case 't':
|
||||
oi.type_name = &sb;
|
||||
if (oid_object_info_extended(&oid, &oi, flags) < 0)
|
||||
if (oid_object_info_extended(the_repository, &oid, &oi, flags) < 0)
|
||||
die("git cat-file: could not get object info");
|
||||
if (sb.len) {
|
||||
printf("%s\n", sb.buf);
|
||||
@ -88,7 +88,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
|
||||
|
||||
case 's':
|
||||
oi.sizep = &size;
|
||||
if (oid_object_info_extended(&oid, &oi, flags) < 0)
|
||||
if (oid_object_info_extended(the_repository, &oid, &oi, flags) < 0)
|
||||
die("git cat-file: could not get object info");
|
||||
printf("%lu\n", size);
|
||||
return 0;
|
||||
@ -342,7 +342,7 @@ static void batch_object_write(const char *obj_name, struct batch_options *opt,
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
|
||||
if (!data->skip_object_info &&
|
||||
oid_object_info_extended(&data->oid, &data->info,
|
||||
oid_object_info_extended(the_repository, &data->oid, &data->info,
|
||||
OBJECT_INFO_LOOKUP_REPLACE) < 0) {
|
||||
printf("%s missing\n",
|
||||
obj_name ? obj_name : oid_to_hex(&data->oid));
|
||||
|
Reference in New Issue
Block a user