mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
object-file: rename has_loose_object()
Rename `has_loose_object()` to `odb_source_loose_has_object()` so that it becomes clear that this is tied to a specific loose object source. This matches our modern naming schema for functions. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ff7ad5cb39
commit
05130c6c9e
@@ -1716,7 +1716,7 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
|
||||
*/
|
||||
struct odb_source *source = the_repository->objects->sources->next;
|
||||
for (; source; source = source->next)
|
||||
if (has_loose_object(source, oid))
|
||||
if (odb_source_loose_has_object(source, oid))
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3978,7 +3978,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
|
||||
int found = 0;
|
||||
|
||||
for (; !found && source; source = source->next)
|
||||
if (has_loose_object(source, oid))
|
||||
if (odb_source_loose_has_object(source, oid))
|
||||
found = 1;
|
||||
|
||||
/*
|
||||
|
||||
@@ -99,8 +99,8 @@ static int check_and_freshen_source(struct odb_source *source,
|
||||
return check_and_freshen_file(path.buf, freshen);
|
||||
}
|
||||
|
||||
int has_loose_object(struct odb_source *source,
|
||||
const struct object_id *oid)
|
||||
int odb_source_loose_has_object(struct odb_source *source,
|
||||
const struct object_id *oid)
|
||||
{
|
||||
return check_and_freshen_source(source, oid, 0);
|
||||
}
|
||||
@@ -1161,7 +1161,7 @@ int force_object_loose(struct odb_source *source,
|
||||
int ret;
|
||||
|
||||
for (struct odb_source *s = source->odb->sources; s; s = s->next)
|
||||
if (has_loose_object(s, oid))
|
||||
if (odb_source_loose_has_object(s, oid))
|
||||
return 0;
|
||||
|
||||
oi.typep = &type;
|
||||
|
||||
@@ -51,6 +51,14 @@ void *odb_source_loose_map_object(struct odb_source *source,
|
||||
const struct object_id *oid,
|
||||
unsigned long *size);
|
||||
|
||||
/*
|
||||
* Return true iff an object database source has a loose object
|
||||
* with the specified name. This function does not respect replace
|
||||
* references.
|
||||
*/
|
||||
int odb_source_loose_has_object(struct odb_source *source,
|
||||
const struct object_id *oid);
|
||||
|
||||
/*
|
||||
* Populate and return the loose object cache array corresponding to the
|
||||
* given object ID.
|
||||
@@ -66,14 +74,6 @@ const char *odb_loose_path(struct odb_source *source,
|
||||
struct strbuf *buf,
|
||||
const struct object_id *oid);
|
||||
|
||||
/*
|
||||
* Return true iff an object database source has a loose object
|
||||
* with the specified name. This function does not respect replace
|
||||
* references.
|
||||
*/
|
||||
int has_loose_object(struct odb_source *source,
|
||||
const struct object_id *oid);
|
||||
|
||||
/*
|
||||
* Iterate over the files in the loose-object parts of the object
|
||||
* directory "path", triggering the following callbacks:
|
||||
|
||||
Reference in New Issue
Block a user