Skip to content

Commit c63911b

Browse files
pks-tgitster
authored andcommitted
odb: rename odb_has_object() flags
Rename `odb_has_object()` flags to be properly prefixed with the function name. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b2d421e commit c63911b

22 files changed

Lines changed: 38 additions & 38 deletions

builtin/cat-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
161161

162162
case 'e':
163163
ret = !odb_has_object(the_repository->objects, &oid,
164-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR);
164+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR);
165165
goto cleanup;
166166

167167
case 'w':

builtin/fetch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ static int update_local_ref(struct ref *ref,
946946
int fast_forward = 0;
947947

948948
if (!odb_has_object(the_repository->objects, &ref->new_oid,
949-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
949+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
950950
die(_("object %s not found"), oid_to_hex(&ref->new_oid));
951951

952952
if (oideq(&ref->old_oid, &ref->new_oid)) {
@@ -1396,7 +1396,7 @@ static int check_exist_and_connected(struct ref *ref_map)
13961396
*/
13971397
for (r = rm; r; r = r->next) {
13981398
if (!odb_has_object(the_repository->objects, &r->old_oid,
1399-
HAS_OBJECT_RECHECK_PACKED))
1399+
ODB_HAS_OBJECT_RECHECK_PACKED))
14001400
return -1;
14011401
}
14021402

builtin/fsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int mark_object(struct object *obj, enum object_type type,
163163

164164
if (!(obj->flags & HAS_OBJ)) {
165165
if (parent && !odb_has_object(the_repository->objects, &obj->oid,
166-
HAS_OBJECT_RECHECK_PACKED)) {
166+
ODB_HAS_OBJECT_RECHECK_PACKED)) {
167167
printf_ln(_("broken link from %7s %s\n"
168168
" to %7s %s"),
169169
printable_type(&parent->oid, parent->type),

builtin/index-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
891891
if (startup_info->have_repository) {
892892
read_lock();
893893
collision_test_needed = odb_has_object(the_repository->objects, oid,
894-
HAS_OBJECT_FETCH_PROMISOR);
894+
ODB_HAS_OBJECT_FETCH_PROMISOR);
895895
read_unlock();
896896
}
897897

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
15461546

15471547
if (!is_null_oid(new_oid) &&
15481548
!odb_has_object(the_repository->objects, new_oid,
1549-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
1549+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
15501550
error("unpack should have generated %s, "
15511551
"but I can't find it!", oid_to_hex(new_oid));
15521552
ret = "bad pack";

builtin/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int get_push_ref_states(const struct ref *remote_refs,
473473
else if (is_null_oid(&ref->old_oid))
474474
info->status = PUSH_STATUS_CREATE;
475475
else if (odb_has_object(the_repository->objects, &ref->old_oid,
476-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) &&
476+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) &&
477477
ref_newer(&ref->new_oid, &ref->old_oid))
478478
info->status = PUSH_STATUS_FASTFORWARD;
479479
else

builtin/show-ref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void show_one(const struct show_one_options *opts,
3737
struct object_id peeled;
3838

3939
if (!odb_has_object(the_repository->objects, ref->oid,
40-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
40+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
4141
die("git show-ref: bad ref %s (%s)", ref->name,
4242
oid_to_hex(ref->oid));
4343

builtin/unpack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
449449
if (!delta_data)
450450
return;
451451
if (odb_has_object(the_repository->objects, &base_oid,
452-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
452+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
453453
; /* Ok we have this one */
454454
else if (resolve_against_held(nr, &base_oid,
455455
delta_data, delta_size))

cache-tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
239239
return 0;
240240
if (it->entry_count < 0 ||
241241
odb_has_object(the_repository->objects, &it->oid,
242-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
242+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
243243
return 0;
244244
for (i = 0; i < it->subtree_nr; i++) {
245245
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
@@ -292,7 +292,7 @@ static int update_one(struct cache_tree *it,
292292

293293
if (0 <= it->entry_count &&
294294
odb_has_object(the_repository->objects, &it->oid,
295-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
295+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
296296
return it->entry_count;
297297

298298
/*
@@ -400,7 +400,7 @@ static int update_one(struct cache_tree *it,
400400
if (is_null_oid(oid) ||
401401
(!ce_missing_ok &&
402402
!odb_has_object(the_repository->objects, oid,
403-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))) {
403+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))) {
404404
strbuf_release(&buffer);
405405
if (expected_missing)
406406
return -1;
@@ -448,7 +448,7 @@ static int update_one(struct cache_tree *it,
448448
struct object_id oid;
449449
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
450450
OBJ_TREE, &oid);
451-
if (odb_has_object(the_repository->objects, &oid, HAS_OBJECT_RECHECK_PACKED))
451+
if (odb_has_object(the_repository->objects, &oid, ODB_HAS_OBJECT_RECHECK_PACKED))
452452
oidcpy(&it->oid, &oid);
453453
else
454454
to_invalidate = 1;

fetch-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
145145
if (commit) {
146146
if (mark_tags_complete_and_check_obj_db) {
147147
if (!odb_has_object(the_repository->objects, oid,
148-
HAS_OBJECT_RECHECK_PACKED))
148+
ODB_HAS_OBJECT_RECHECK_PACKED))
149149
die_in_commit_graph_only(oid);
150150
}
151151
return commit;
@@ -2013,7 +2013,7 @@ static void update_shallow(struct fetch_pack_args *args,
20132013
struct object_id *oid = si->shallow->oid;
20142014
for (i = 0; i < si->shallow->nr; i++)
20152015
if (odb_has_object(the_repository->objects, &oid[i],
2016-
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
2016+
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
20172017
oid_array_append(&extra, &oid[i]);
20182018
if (extra.nr) {
20192019
setup_alternate_shallow(&shallow_lock,

0 commit comments

Comments
 (0)