summaryrefslogtreecommitdiff
path: root/object-name.c
diff options
context:
space:
mode:
Diffstat (limited to 'object-name.c')
-rw-r--r--object-name.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/object-name.c b/object-name.c
index 11aa0e6afc..f6902e140d 100644
--- a/object-name.c
+++ b/object-name.c
@@ -213,7 +213,7 @@ static void find_short_packed_object(struct disambiguate_state *ds)
unique_in_midx(m, ds);
}
- for (p = get_packed_git(ds->repo); p && !ds->ambiguous;
+ for (p = packfile_store_get_packs(ds->repo->objects->packfiles); p && !ds->ambiguous;
p = p->next)
unique_in_pack(p, ds);
}
@@ -596,7 +596,7 @@ static enum get_oid_result get_short_oid(struct repository *r,
* or migrated from loose to packed.
*/
if (status == MISSING_OBJECT) {
- reprepare_packed_git(r);
+ odb_reprepare(r->objects);
find_short_object_filename(&ds);
find_short_packed_object(&ds);
status = finish_object_disambiguation(&ds, oid);
@@ -696,15 +696,14 @@ static inline char get_hex_char_from_oid(const struct object_id *oid,
return hex[oid->hash[pos >> 1] & 0xf];
}
-static int extend_abbrev_len(const struct object_id *oid, void *cb_data)
+static int extend_abbrev_len(const struct object_id *oid,
+ struct min_abbrev_data *mad)
{
- struct min_abbrev_data *mad = cb_data;
-
unsigned int i = mad->init_len;
while (mad->hex[i] && mad->hex[i] == get_hex_char_from_oid(oid, i))
i++;
- if (i < GIT_MAX_RAWSZ && i >= mad->cur_len)
+ if (mad->hex[i] && i >= mad->cur_len)
mad->cur_len = i + 1;
return 0;
@@ -806,7 +805,7 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
find_abbrev_len_for_midx(m, mad);
}
- for (p = get_packed_git(mad->repo); p; p = p->next)
+ for (p = packfile_store_get_packs(mad->repo->objects->packfiles); p; p = p->next)
find_abbrev_len_for_pack(p, mad);
}
@@ -1525,7 +1524,8 @@ struct grab_nth_branch_switch_cbdata {
struct strbuf *sb;
};
-static int grab_nth_branch_switch(struct object_id *ooid UNUSED,
+static int grab_nth_branch_switch(const char *refname UNUSED,
+ struct object_id *ooid UNUSED,
struct object_id *noid UNUSED,
const char *email UNUSED,
timestamp_t timestamp UNUSED,
@@ -1857,55 +1857,35 @@ int repo_get_oid_committish(struct repository *r,
const char *name,
struct object_id *oid)
{
- struct object_context unused;
- int ret = get_oid_with_context(r, name, GET_OID_COMMITTISH,
- oid, &unused);
- object_context_release(&unused);
- return ret;
+ return repo_get_oid_with_flags(r, name, oid, GET_OID_COMMITTISH);
}
int repo_get_oid_treeish(struct repository *r,
const char *name,
struct object_id *oid)
{
- struct object_context unused;
- int ret = get_oid_with_context(r, name, GET_OID_TREEISH,
- oid, &unused);
- object_context_release(&unused);
- return ret;
+ return repo_get_oid_with_flags(r, name, oid, GET_OID_TREEISH);
}
int repo_get_oid_commit(struct repository *r,
const char *name,
struct object_id *oid)
{
- struct object_context unused;
- int ret = get_oid_with_context(r, name, GET_OID_COMMIT,
- oid, &unused);
- object_context_release(&unused);
- return ret;
+ return repo_get_oid_with_flags(r, name, oid, GET_OID_COMMIT);
}
int repo_get_oid_tree(struct repository *r,
const char *name,
struct object_id *oid)
{
- struct object_context unused;
- int ret = get_oid_with_context(r, name, GET_OID_TREE,
- oid, &unused);
- object_context_release(&unused);
- return ret;
+ return repo_get_oid_with_flags(r, name, oid, GET_OID_TREE);
}
int repo_get_oid_blob(struct repository *r,
const char *name,
struct object_id *oid)
{
- struct object_context unused;
- int ret = get_oid_with_context(r, name, GET_OID_BLOB,
- oid, &unused);
- object_context_release(&unused);
- return ret;
+ return repo_get_oid_with_flags(r, name, oid, GET_OID_BLOB);
}
/* Must be called only when object_name:filename doesn't exist. */