Skip to content

Commit 05130c6

Browse files
pks-tgitster
authored andcommitted
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>
1 parent ff7ad5c commit 05130c6

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

builtin/pack-objects.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
17161716
*/
17171717
struct odb_source *source = the_repository->objects->sources->next;
17181718
for (; source; source = source->next)
1719-
if (has_loose_object(source, oid))
1719+
if (odb_source_loose_has_object(source, oid))
17201720
return 0;
17211721
}
17221722

@@ -3978,7 +3978,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
39783978
int found = 0;
39793979

39803980
for (; !found && source; source = source->next)
3981-
if (has_loose_object(source, oid))
3981+
if (odb_source_loose_has_object(source, oid))
39823982
found = 1;
39833983

39843984
/*

object-file.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ static int check_and_freshen_source(struct odb_source *source,
9999
return check_and_freshen_file(path.buf, freshen);
100100
}
101101

102-
int has_loose_object(struct odb_source *source,
103-
const struct object_id *oid)
102+
int odb_source_loose_has_object(struct odb_source *source,
103+
const struct object_id *oid)
104104
{
105105
return check_and_freshen_source(source, oid, 0);
106106
}
@@ -1161,7 +1161,7 @@ int force_object_loose(struct odb_source *source,
11611161
int ret;
11621162

11631163
for (struct odb_source *s = source->odb->sources; s; s = s->next)
1164-
if (has_loose_object(s, oid))
1164+
if (odb_source_loose_has_object(s, oid))
11651165
return 0;
11661166

11671167
oi.typep = &type;

object-file.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ void *odb_source_loose_map_object(struct odb_source *source,
5151
const struct object_id *oid,
5252
unsigned long *size);
5353

54+
/*
55+
* Return true iff an object database source has a loose object
56+
* with the specified name. This function does not respect replace
57+
* references.
58+
*/
59+
int odb_source_loose_has_object(struct odb_source *source,
60+
const struct object_id *oid);
61+
5462
/*
5563
* Populate and return the loose object cache array corresponding to the
5664
* given object ID.
@@ -66,14 +74,6 @@ const char *odb_loose_path(struct odb_source *source,
6674
struct strbuf *buf,
6775
const struct object_id *oid);
6876

69-
/*
70-
* Return true iff an object database source has a loose object
71-
* with the specified name. This function does not respect replace
72-
* references.
73-
*/
74-
int has_loose_object(struct odb_source *source,
75-
const struct object_id *oid);
76-
7777
/*
7878
* Iterate over the files in the loose-object parts of the object
7979
* directory "path", triggering the following callbacks:

0 commit comments

Comments
 (0)