Skip to content

Commit fbd67ab

Browse files
committed
Merge branch 'ps/odb-clean-stale-wrappers'
Code clean-up. * ps/odb-clean-stale-wrappers: odb: drop deprecated wrapper functions
2 parents c281795 + e1d062e commit fbd67ab

File tree

4 files changed

+8
-42
lines changed

4 files changed

+8
-42
lines changed

builtin/pack-objects.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3774,7 +3774,7 @@ static void show_object_pack_hint(struct object *object, const char *name,
37743774
enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
37753775
if (mode == STDIN_PACKS_MODE_FOLLOW) {
37763776
if (object->type == OBJ_BLOB &&
3777-
!has_object(the_repository, &object->oid, 0))
3777+
!odb_has_object(the_repository->objects, &object->oid, 0))
37783778
return;
37793779
add_object_entry(&object->oid, object->type, name, 0);
37803780
} else {
@@ -4596,8 +4596,8 @@ static int add_objects_by_path(const char *path,
45964596

45974597
/* Skip objects that do not exist locally. */
45984598
if ((exclude_promisor_objects || arg_missing_action != MA_ERROR) &&
4599-
oid_object_info_extended(the_repository, oid, &oi,
4600-
OBJECT_INFO_FOR_PREFETCH) < 0)
4599+
odb_read_object_info_extended(the_repository->objects, oid, &oi,
4600+
OBJECT_INFO_FOR_PREFETCH) < 0)
46014601
continue;
46024602

46034603
exclude = is_oid_uninteresting(the_repository, oid);

odb.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -489,37 +489,4 @@ static inline int odb_write_object(struct object_database *odb,
489489
return odb_write_object_ext(odb, buf, len, type, oid, NULL, 0);
490490
}
491491

492-
/* Compatibility wrappers, to be removed once Git 2.51 has been released. */
493-
#include "repository.h"
494-
495-
static inline int oid_object_info_extended(struct repository *r,
496-
const struct object_id *oid,
497-
struct object_info *oi,
498-
unsigned flags)
499-
{
500-
return odb_read_object_info_extended(r->objects, oid, oi, flags);
501-
}
502-
503-
static inline int oid_object_info(struct repository *r,
504-
const struct object_id *oid,
505-
unsigned long *sizep)
506-
{
507-
return odb_read_object_info(r->objects, oid, sizep);
508-
}
509-
510-
static inline void *repo_read_object_file(struct repository *r,
511-
const struct object_id *oid,
512-
enum object_type *type,
513-
unsigned long *size)
514-
{
515-
return odb_read_object(r->objects, oid, type, size);
516-
}
517-
518-
static inline int has_object(struct repository *r,
519-
const struct object_id *oid,
520-
unsigned flags)
521-
{
522-
return odb_has_object(r->objects, oid, flags);
523-
}
524-
525492
#endif /* ODB_H */

pack-objects.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "pack-objects.h"
55
#include "packfile.h"
66
#include "parse.h"
7+
#include "repository.h"
78

89
static uint32_t locate_object_entry_hash(struct packing_data *pdata,
910
const struct object_id *oid,

t/helper/test-pack-deltas.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,14 @@ static void write_ref_delta(struct hashfile *f,
5151
unsigned long size, base_size, delta_size, compressed_size, hdrlen;
5252
enum object_type type;
5353
void *base_buf, *delta_buf;
54-
void *buf = repo_read_object_file(the_repository,
55-
oid, &type,
56-
&size);
54+
void *buf = odb_read_object(the_repository->objects,
55+
oid, &type, &size);
5756

5857
if (!buf)
5958
die("unable to read %s", oid_to_hex(oid));
6059

61-
base_buf = repo_read_object_file(the_repository,
62-
base, &type,
63-
&base_size);
60+
base_buf = odb_read_object(the_repository->objects,
61+
base, &type, &base_size);
6462

6563
if (!base_buf)
6664
die("unable to read %s", oid_to_hex(base));

0 commit comments

Comments
 (0)