Merge branch 'ps/odb-cleanup' into next

Various code clean-up around odb subsystem.

* ps/odb-cleanup:
  odb: drop unneeded headers and forward decls
  odb: rename `odb_has_object()` flags
  odb: use enum for `odb_write_object` flags
  odb: rename `odb_write_object()` flags
  treewide: use enum for `odb_for_each_object()` flags
  CodingGuidelines: document our style for flags
This commit is contained in:
Junio C Hamano
2026-04-02 13:30:44 -07:00
28 changed files with 72 additions and 64 deletions

View File

@@ -668,6 +668,18 @@ For C programs:
unsigned other_field:1;
unsigned field_with_longer_name:1;
- When a function `F` accepts flags, those flags should be defined as `enum
F_flags`. Individual flag definitions should start with `F` and be in
all-uppercase letters. Flag values should be represented via bit shifts.
E.g.
enum frobnicate_flags {
FROBNICATE_FOO = (1 << 0),
FROBNICATE_BAR = (1 << 1),
};
int frobnicate(enum frobnicate_flags flags);
- Array names should be named in the singular form if the individual items are
subject of use. E.g.:

View File

@@ -161,7 +161,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
case 'e':
ret = !odb_has_object(the_repository->objects, &oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR);
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR);
goto cleanup;
case 'w':

View File

@@ -946,7 +946,7 @@ static int update_local_ref(struct ref *ref,
int fast_forward = 0;
if (!odb_has_object(the_repository->objects, &ref->new_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
die(_("object %s not found"), oid_to_hex(&ref->new_oid));
if (oideq(&ref->old_oid, &ref->new_oid)) {
@@ -1396,7 +1396,7 @@ static int check_exist_and_connected(struct ref *ref_map)
*/
for (r = rm; r; r = r->next) {
if (!odb_has_object(the_repository->objects, &r->old_oid,
HAS_OBJECT_RECHECK_PACKED))
ODB_HAS_OBJECT_RECHECK_PACKED))
return -1;
}

View File

@@ -162,7 +162,7 @@ static int mark_object(struct object *obj, enum object_type type,
if (!(obj->flags & HAS_OBJ)) {
if (parent && !odb_has_object(options->repo->objects, &obj->oid,
HAS_OBJECT_RECHECK_PACKED)) {
ODB_HAS_OBJECT_RECHECK_PACKED)) {
printf_ln(_("broken link from %7s %s\n"
" to %7s %s"),
printable_type(options->repo, &parent->oid, parent->type),

View File

@@ -891,7 +891,7 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
if (startup_info->have_repository) {
read_lock();
collision_test_needed = odb_has_object(the_repository->objects, oid,
HAS_OBJECT_FETCH_PROMISOR);
ODB_HAS_OBJECT_FETCH_PROMISOR);
read_unlock();
}

View File

@@ -1542,7 +1542,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
if (!is_null_oid(new_oid) &&
!odb_has_object(the_repository->objects, new_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
error("unpack should have generated %s, "
"but I can't find it!", oid_to_hex(new_oid));
ret = "bad pack";

View File

@@ -473,7 +473,7 @@ static int get_push_ref_states(const struct ref *remote_refs,
else if (is_null_oid(&ref->old_oid))
info->status = PUSH_STATUS_CREATE;
else if (odb_has_object(the_repository->objects, &ref->old_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) &&
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) &&
ref_newer(&ref->new_oid, &ref->old_oid))
info->status = PUSH_STATUS_FASTFORWARD;
else

View File

@@ -37,7 +37,7 @@ static void show_one(const struct show_one_options *opts,
struct object_id peeled;
if (!odb_has_object(the_repository->objects, ref->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
die("git show-ref: bad ref %s (%s)", ref->name,
oid_to_hex(ref->oid));

View File

@@ -449,7 +449,7 @@ static void unpack_delta_entry(enum object_type type, unsigned long delta_size,
if (!delta_data)
return;
if (odb_has_object(the_repository->objects, &base_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
; /* Ok we have this one */
else if (resolve_against_held(nr, &base_oid,
delta_data, delta_size))

View File

@@ -239,7 +239,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
return 0;
if (it->entry_count < 0 ||
odb_has_object(the_repository->objects, &it->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return 0;
for (i = 0; i < it->subtree_nr; i++) {
if (!cache_tree_fully_valid(it->down[i]->cache_tree))
@@ -292,7 +292,7 @@ static int update_one(struct cache_tree *it,
if (0 <= it->entry_count &&
odb_has_object(the_repository->objects, &it->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return it->entry_count;
/*
@@ -400,7 +400,7 @@ static int update_one(struct cache_tree *it,
if (is_null_oid(oid) ||
(!ce_missing_ok &&
!odb_has_object(the_repository->objects, oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))) {
strbuf_release(&buffer);
if (expected_missing)
return -1;
@@ -448,7 +448,7 @@ static int update_one(struct cache_tree *it,
struct object_id oid;
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
OBJ_TREE, &oid);
if (odb_has_object(the_repository->objects, &oid, HAS_OBJECT_RECHECK_PACKED))
if (odb_has_object(the_repository->objects, &oid, ODB_HAS_OBJECT_RECHECK_PACKED))
oidcpy(&it->oid, &oid);
else
to_invalidate = 1;
@@ -456,7 +456,7 @@ static int update_one(struct cache_tree *it,
hash_object_file(the_hash_algo, buffer.buf, buffer.len,
OBJ_TREE, &it->oid);
} else if (odb_write_object_ext(the_repository->objects, buffer.buf, buffer.len, OBJ_TREE,
&it->oid, NULL, flags & WRITE_TREE_SILENT ? WRITE_OBJECT_SILENT : 0)) {
&it->oid, NULL, flags & WRITE_TREE_SILENT ? ODB_WRITE_OBJECT_SILENT : 0)) {
strbuf_release(&buffer);
return -1;
}

View File

@@ -144,7 +144,7 @@ static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
if (commit) {
if (mark_tags_complete_and_check_obj_db) {
if (!odb_has_object(the_repository->objects, oid,
HAS_OBJECT_RECHECK_PACKED))
ODB_HAS_OBJECT_RECHECK_PACKED))
die_in_commit_graph_only(oid);
}
return commit;
@@ -2016,7 +2016,7 @@ static void update_shallow(struct fetch_pack_args *args,
struct object_id *oid = si->shallow->oid;
for (i = 0; i < si->shallow->nr; i++)
if (odb_has_object(the_repository->objects, &oid[i],
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
oid_array_append(&extra, &oid[i]);
if (extra.nr) {
setup_alternate_shallow(&shallow_lock,

View File

@@ -1449,7 +1449,7 @@ static void one_remote_ref(const char *refname)
*/
if (repo->can_update_info_refs &&
!odb_has_object(the_repository->objects, &ref->old_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
obj = lookup_unknown_object(the_repository, &ref->old_oid);
fprintf(stderr, " fetch %s for %s\n",
oid_to_hex(&ref->old_oid), refname);
@@ -1655,7 +1655,7 @@ static int delete_remote_branch(const char *pattern, int force)
if (is_null_oid(&head_oid))
return error("Unable to resolve remote HEAD");
if (!odb_has_object(the_repository->objects, &head_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return error("Remote HEAD resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", oid_to_hex(&head_oid));
/* Remote branch must resolve to a known object */
@@ -1663,7 +1663,7 @@ static int delete_remote_branch(const char *pattern, int force)
return error("Unable to resolve remote branch %s",
remote_ref->name);
if (!odb_has_object(the_repository->objects, &remote_ref->old_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return error("Remote branch %s resolves to object %s\nwhich does not exist locally, perhaps you need to fetch?", remote_ref->name, oid_to_hex(&remote_ref->old_oid));
/* Remote branch must be an ancestor of remote HEAD */
@@ -1886,7 +1886,7 @@ int cmd_main(int argc, const char **argv)
!is_null_oid(&ref->old_oid) &&
!ref->force) {
if (!odb_has_object(the_repository->objects, &ref->old_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) ||
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) ||
!ref_newer(&ref->peer_ref->new_oid,
&ref->old_oid)) {
/*

View File

@@ -139,7 +139,7 @@ static int fill_active_slot(void *data UNUSED)
obj_req = list_entry(pos, struct object_request, node);
if (obj_req->state == WAITING) {
if (odb_has_object(the_repository->objects, &obj_req->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
obj_req->state = COMPLETE;
else {
start_object_request(obj_req);
@@ -495,7 +495,7 @@ static int fetch_object(struct walker *walker, const struct object_id *oid)
return error("Couldn't find request for %s in the queue", hex);
if (odb_has_object(the_repository->objects, &obj_req->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
if (obj_req->req)
abort_http_object_request(&obj_req->req);
abort_object_request(obj_req);

View File

@@ -75,7 +75,7 @@ static void process_blob(struct traversal_context *ctx,
*/
if (ctx->revs->exclude_promisor_objects &&
!odb_has_object(the_repository->objects, &obj->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) &&
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) &&
is_promisor_object(ctx->revs->repo, &obj->oid))
return;

View File

@@ -796,7 +796,7 @@ static int prune_notes_helper(const struct object_id *object_oid,
struct note_delete_list *n;
if (odb_has_object(the_repository->objects, object_oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return 0; /* nothing to do for this note */
/* failed to find object => prune this note */

View File

@@ -909,7 +909,7 @@ static int start_loose_object_common(struct odb_source *source,
fd = create_tmpfile(source->odb->repo, tmp_file, filename);
if (fd < 0) {
if (flags & WRITE_OBJECT_SILENT)
if (flags & ODB_WRITE_OBJECT_SILENT)
return -1;
else if (errno == EACCES)
return error(_("insufficient permission for adding "
@@ -1042,7 +1042,7 @@ static int write_loose_object(struct odb_source *source,
utb.actime = mtime;
utb.modtime = mtime;
if (utime(tmp_file.buf, &utb) < 0 &&
!(flags & WRITE_OBJECT_SILENT))
!(flags & ODB_WRITE_OBJECT_SILENT))
warning_errno(_("failed utime() on %s"), tmp_file.buf);
}
@@ -1169,7 +1169,8 @@ cleanup:
int odb_source_loose_write_object(struct odb_source *source,
const void *buf, unsigned long len,
enum object_type type, struct object_id *oid,
struct object_id *compat_oid_in, unsigned flags)
struct object_id *compat_oid_in,
enum odb_write_object_flags flags)
{
const struct git_hash_algo *algo = source->odb->repo->hash_algo;
const struct git_hash_algo *compat = source->odb->repo->compat_hash_algo;
@@ -1378,7 +1379,7 @@ static int already_written(struct odb_transaction_files *transaction,
{
/* The object may already exist in the repository */
if (odb_has_object(transaction->base.source->odb, oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return 1;
/* Might want to keep the list sorted */

View File

@@ -68,7 +68,8 @@ int odb_source_loose_freshen_object(struct odb_source *source,
int odb_source_loose_write_object(struct odb_source *source,
const void *buf, unsigned long len,
enum object_type type, struct object_id *oid,
struct object_id *compat_oid_in, unsigned flags);
struct object_id *compat_oid_in,
enum odb_write_object_flags flags);
int odb_source_loose_write_stream(struct odb_source *source,
struct odb_write_stream *stream, size_t len,

10
odb.c
View File

@@ -872,15 +872,15 @@ void *odb_read_object_peeled(struct object_database *odb,
}
int odb_has_object(struct object_database *odb, const struct object_id *oid,
enum has_object_flags flags)
enum odb_has_object_flags flags)
{
unsigned object_info_flags = 0;
if (!startup_info->have_repository)
return 0;
if (!(flags & HAS_OBJECT_RECHECK_PACKED))
if (!(flags & ODB_HAS_OBJECT_RECHECK_PACKED))
object_info_flags |= OBJECT_INFO_QUICK;
if (!(flags & HAS_OBJECT_FETCH_PROMISOR))
if (!(flags & ODB_HAS_OBJECT_FETCH_PROMISOR))
object_info_flags |= OBJECT_INFO_SKIP_FETCH_OBJECT;
return odb_read_object_info_extended(odb, oid, NULL, object_info_flags) >= 0;
@@ -922,7 +922,7 @@ int odb_for_each_object(struct object_database *odb,
const struct object_info *request,
odb_for_each_object_cb cb,
void *cb_data,
unsigned flags)
enum odb_for_each_object_flags flags)
{
struct odb_for_each_object_options opts = {
.flags = flags,
@@ -1053,7 +1053,7 @@ int odb_write_object_ext(struct object_database *odb,
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags)
enum odb_write_object_flags flags)
{
return odb_source_write_object(odb->sources, buf, len, type,
oid, compat_oid, flags);

30
odb.h
View File

@@ -1,19 +1,17 @@
#ifndef ODB_H
#define ODB_H
#include "hashmap.h"
#include "object.h"
#include "oidset.h"
#include "oidmap.h"
#include "string-list.h"
#include "thread-utils.h"
struct oidmap;
struct oidtree;
struct cached_object_entry;
struct packed_git;
struct repository;
struct strbuf;
struct strvec;
struct repository;
struct multi_pack_index;
/*
* Set this to 0 to prevent odb_read_object_info_extended() from fetching missing
@@ -31,10 +29,6 @@ extern int fetch_if_missing;
*/
char *compute_alternate_path(const char *path, struct strbuf *err);
struct packed_git;
struct packfile_store;
struct cached_object_entry;
/*
* A transaction may be started for an object database prior to writing new
* objects via odb_transaction_begin(). These objects are not committed until
@@ -395,11 +389,11 @@ int odb_read_object_info(struct object_database *odb,
const struct object_id *oid,
unsigned long *sizep);
enum has_object_flags {
enum odb_has_object_flags {
/* Retry packed storage after checking packed and loose storage */
HAS_OBJECT_RECHECK_PACKED = (1 << 0),
ODB_HAS_OBJECT_RECHECK_PACKED = (1 << 0),
/* Allow fetching the object in case the repository has a promisor remote. */
HAS_OBJECT_FETCH_PROMISOR = (1 << 1),
ODB_HAS_OBJECT_FETCH_PROMISOR = (1 << 1),
};
/*
@@ -408,7 +402,7 @@ enum has_object_flags {
*/
int odb_has_object(struct object_database *odb,
const struct object_id *oid,
enum has_object_flags flags);
enum odb_has_object_flags flags);
int odb_freshen_object(struct object_database *odb,
const struct object_id *oid);
@@ -522,7 +516,7 @@ int odb_for_each_object(struct object_database *odb,
const struct object_info *request,
odb_for_each_object_cb cb,
void *cb_data,
unsigned flags);
enum odb_for_each_object_flags flags);
enum odb_count_objects_flags {
/*
@@ -561,19 +555,19 @@ int odb_find_abbrev_len(struct object_database *odb,
int min_len,
unsigned *out);
enum {
enum odb_write_object_flags {
/*
* By default, `odb_write_object()` does not actually write anything
* into the object store, but only computes the object ID. This flag
* changes that so that the object will be written as a loose object
* and persisted.
*/
WRITE_OBJECT_PERSIST = (1 << 0),
ODB_WRITE_OBJECT_PERSIST = (1 << 0),
/*
* Do not print an error in case something goes wrong.
*/
WRITE_OBJECT_SILENT = (1 << 1),
ODB_WRITE_OBJECT_SILENT = (1 << 1),
};
/*
@@ -589,7 +583,7 @@ int odb_write_object_ext(struct object_database *odb,
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags);
enum odb_write_object_flags flags);
static inline int odb_write_object(struct object_database *odb,
const void *buf, unsigned long len,

View File

@@ -161,7 +161,7 @@ static int odb_source_files_write_object(struct odb_source *source,
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags)
enum odb_write_object_flags flags)
{
return odb_source_loose_write_object(source, buf, len, type,
oid, compat_oid, flags);

View File

@@ -197,7 +197,7 @@ struct odb_source {
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags);
enum odb_write_object_flags flags);
/*
* This callback is expected to persist the given object stream into
@@ -405,7 +405,7 @@ static inline int odb_source_write_object(struct odb_source *source,
enum object_type type,
struct object_id *oid,
struct object_id *compat_oid,
unsigned flags)
enum odb_write_object_flags flags)
{
return source->write_object(source, buf, len, type, oid,
compat_oid, flags);

View File

@@ -2300,7 +2300,7 @@ int has_object_kept_pack(struct repository *r, const struct object_id *oid,
int for_each_object_in_pack(struct packed_git *p,
each_packed_object_fn cb, void *data,
unsigned flags)
enum odb_for_each_object_flags flags)
{
uint32_t i;
int r = 0;

View File

@@ -354,7 +354,7 @@ typedef int each_packed_object_fn(const struct object_id *oid,
void *data);
int for_each_object_in_pack(struct packed_git *p,
each_packed_object_fn, void *data,
unsigned flags);
enum odb_for_each_object_flags flags);
/*
* Iterate through all packed objects in the given packfile store and invoke

View File

@@ -168,7 +168,7 @@ static int tree_is_complete(const struct object_id *oid)
complete = 1;
while (tree_entry(&desc, &entry)) {
if (!odb_has_object(the_repository->objects, &entry.oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR) ||
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR) ||
(S_ISDIR(entry.mode) && !tree_is_complete(&entry.oid))) {
tree->object.flags |= INCOMPLETE;
complete = 0;

2
refs.c
View File

@@ -425,7 +425,7 @@ int ref_resolves_to_object(const char *refname,
if (flags & REF_ISBROKEN)
return 0;
if (!odb_has_object(repo->objects, oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
error(_("%s does not point to a valid object!"), refname);
return 0;
}

View File

@@ -1723,7 +1723,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
if (!reject_reason && !ref->deletion && !is_null_oid(&ref->old_oid)) {
if (starts_with(ref->name, "refs/tags/"))
reject_reason = REF_STATUS_REJECT_ALREADY_EXISTS;
else if (!odb_has_object(the_repository->objects, &ref->old_oid, HAS_OBJECT_RECHECK_PACKED))
else if (!odb_has_object(the_repository->objects, &ref->old_oid, ODB_HAS_OBJECT_RECHECK_PACKED))
reject_reason = REF_STATUS_REJECT_FETCH_FIRST;
else if (!lookup_commit_reference_gently(the_repository, &ref->old_oid, 1) ||
!lookup_commit_reference_gently(the_repository, &ref->new_oid, 1))

View File

@@ -360,7 +360,7 @@ static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
return 0;
if (data->flags & QUICK) {
if (!odb_has_object(the_repository->objects, &graft->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
return 0;
} else if (data->flags & SEEN_ONLY) {
struct commit *c = lookup_commit(the_repository, &graft->oid);
@@ -528,7 +528,7 @@ void prepare_shallow_info(struct shallow_info *info, struct oid_array *sa)
ALLOC_ARRAY(info->theirs, sa->nr);
for (size_t i = 0; i < sa->nr; i++) {
if (odb_has_object(the_repository->objects, sa->oid + i,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
struct commit_graft *graft;
graft = lookup_commit_graft(the_repository,
&sa->oid[i]);
@@ -567,7 +567,7 @@ void remove_nonexistent_theirs_shallow(struct shallow_info *info)
if (i != dst)
info->theirs[dst] = info->theirs[i];
if (odb_has_object(the_repository->objects, oid + info->theirs[i],
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
dst++;
}
info->nr_theirs = dst;

View File

@@ -155,7 +155,7 @@ static int process(struct walker *walker, struct object *obj)
obj->flags |= SEEN;
if (odb_has_object(the_repository->objects, &obj->oid,
HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR)) {
/* We already have it, so we should scan it now. */
obj->flags |= TO_SCAN;
}