Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-03-28 16:58:50 +0300
committerJunio C Hamano <gitster@pobox.com>2023-03-28 17:36:45 +0300
commitbc726bd075929aab6b3e09d4dd5c2b0726fd5350 (patch)
tree8e4337a056037e0950944c1046c6f90d0d615bbb /builtin/cat-file.c
parent085390328f5fe1dfba67039b1fd6cc51546a4e41 (diff)
cocci: apply the "object-store.h" part of "the_repository.pending"
Apply the part of "the_repository.pending.cocci" pertaining to "object-store.h". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r--builtin/cat-file.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index cc17635e76..caf2d25861 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -60,7 +60,7 @@ static int filter_object(const char *path, unsigned mode,
{
enum object_type type;
- *buf = read_object_file(oid, &type, size);
+ *buf = repo_read_object_file(the_repository, oid, &type, size);
if (!*buf)
return error(_("cannot read object %s '%s'"),
oid_to_hex(oid), path);
@@ -152,7 +152,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
goto cleanup;
case 'e':
- return !has_object_file(&oid);
+ return !repo_has_object_file(the_repository, &oid);
case 'w':
@@ -187,7 +187,8 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
ret = stream_blob(&oid);
goto cleanup;
}
- buf = read_object_file(&oid, &type, &size);
+ buf = repo_read_object_file(the_repository, &oid, &type,
+ &size);
if (!buf)
die("Cannot read object %s", obj_name);
@@ -207,8 +208,10 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
if (exp_type_id == OBJ_BLOB) {
struct object_id blob_oid;
if (oid_object_info(the_repository, &oid, NULL) == OBJ_TAG) {
- char *buffer = read_object_file(&oid, &type,
- &size);
+ char *buffer = repo_read_object_file(the_repository,
+ &oid,
+ &type,
+ &size);
const char *target;
if (!skip_prefix(buffer, "object ", &target) ||
get_oid_hex(target, &blob_oid))
@@ -383,9 +386,10 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
if (!textconv_object(the_repository,
data->rest, 0100644, oid,
1, &contents, &size))
- contents = read_object_file(oid,
- &type,
- &size);
+ contents = repo_read_object_file(the_repository,
+ oid,
+ &type,
+ &size);
if (!contents)
die("could not convert '%s' %s",
oid_to_hex(oid), data->rest);
@@ -402,7 +406,8 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
unsigned long size;
void *contents;
- contents = read_object_file(oid, &type, &size);
+ contents = repo_read_object_file(the_repository, oid, &type,
+ &size);
if (use_mailmap) {
size_t s = size;