Merge branch 'ps/odb-clean-stale-wrappers' into jch
Code clean-up. * ps/odb-clean-stale-wrappers: odb: drop deprecated wrapper functionsseen
commit
64a6bd8ec6
|
@ -3774,7 +3774,7 @@ static void show_object_pack_hint(struct object *object, const char *name,
|
||||||
enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
|
enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
|
||||||
if (mode == STDIN_PACKS_MODE_FOLLOW) {
|
if (mode == STDIN_PACKS_MODE_FOLLOW) {
|
||||||
if (object->type == OBJ_BLOB &&
|
if (object->type == OBJ_BLOB &&
|
||||||
!has_object(the_repository, &object->oid, 0))
|
!odb_has_object(the_repository->objects, &object->oid, 0))
|
||||||
return;
|
return;
|
||||||
add_object_entry(&object->oid, object->type, name, 0);
|
add_object_entry(&object->oid, object->type, name, 0);
|
||||||
} else {
|
} else {
|
||||||
|
@ -4596,8 +4596,8 @@ static int add_objects_by_path(const char *path,
|
||||||
|
|
||||||
/* Skip objects that do not exist locally. */
|
/* Skip objects that do not exist locally. */
|
||||||
if ((exclude_promisor_objects || arg_missing_action != MA_ERROR) &&
|
if ((exclude_promisor_objects || arg_missing_action != MA_ERROR) &&
|
||||||
oid_object_info_extended(the_repository, oid, &oi,
|
odb_read_object_info_extended(the_repository->objects, oid, &oi,
|
||||||
OBJECT_INFO_FOR_PREFETCH) < 0)
|
OBJECT_INFO_FOR_PREFETCH) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
exclude = is_oid_uninteresting(the_repository, oid);
|
exclude = is_oid_uninteresting(the_repository, oid);
|
||||||
|
|
33
odb.h
33
odb.h
|
@ -489,37 +489,4 @@ static inline int odb_write_object(struct object_database *odb,
|
||||||
return odb_write_object_ext(odb, buf, len, type, oid, NULL, 0);
|
return odb_write_object_ext(odb, buf, len, type, oid, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compatibility wrappers, to be removed once Git 2.51 has been released. */
|
|
||||||
#include "repository.h"
|
|
||||||
|
|
||||||
static inline int oid_object_info_extended(struct repository *r,
|
|
||||||
const struct object_id *oid,
|
|
||||||
struct object_info *oi,
|
|
||||||
unsigned flags)
|
|
||||||
{
|
|
||||||
return odb_read_object_info_extended(r->objects, oid, oi, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int oid_object_info(struct repository *r,
|
|
||||||
const struct object_id *oid,
|
|
||||||
unsigned long *sizep)
|
|
||||||
{
|
|
||||||
return odb_read_object_info(r->objects, oid, sizep);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void *repo_read_object_file(struct repository *r,
|
|
||||||
const struct object_id *oid,
|
|
||||||
enum object_type *type,
|
|
||||||
unsigned long *size)
|
|
||||||
{
|
|
||||||
return odb_read_object(r->objects, oid, type, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int has_object(struct repository *r,
|
|
||||||
const struct object_id *oid,
|
|
||||||
unsigned flags)
|
|
||||||
{
|
|
||||||
return odb_has_object(r->objects, oid, flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ODB_H */
|
#endif /* ODB_H */
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "pack-objects.h"
|
#include "pack-objects.h"
|
||||||
#include "packfile.h"
|
#include "packfile.h"
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
|
#include "repository.h"
|
||||||
|
|
||||||
static uint32_t locate_object_entry_hash(struct packing_data *pdata,
|
static uint32_t locate_object_entry_hash(struct packing_data *pdata,
|
||||||
const struct object_id *oid,
|
const struct object_id *oid,
|
||||||
|
|
|
@ -51,16 +51,14 @@ static void write_ref_delta(struct hashfile *f,
|
||||||
unsigned long size, base_size, delta_size, compressed_size, hdrlen;
|
unsigned long size, base_size, delta_size, compressed_size, hdrlen;
|
||||||
enum object_type type;
|
enum object_type type;
|
||||||
void *base_buf, *delta_buf;
|
void *base_buf, *delta_buf;
|
||||||
void *buf = repo_read_object_file(the_repository,
|
void *buf = odb_read_object(the_repository->objects,
|
||||||
oid, &type,
|
oid, &type, &size);
|
||||||
&size);
|
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
die("unable to read %s", oid_to_hex(oid));
|
die("unable to read %s", oid_to_hex(oid));
|
||||||
|
|
||||||
base_buf = repo_read_object_file(the_repository,
|
base_buf = odb_read_object(the_repository->objects,
|
||||||
base, &type,
|
base, &type, &base_size);
|
||||||
&base_size);
|
|
||||||
|
|
||||||
if (!base_buf)
|
if (!base_buf)
|
||||||
die("unable to read %s", oid_to_hex(base));
|
die("unable to read %s", oid_to_hex(base));
|
||||||
|
|
Loading…
Reference in New Issue