summaryrefslogtreecommitdiff
path: root/sha1-name.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-11-12 09:48:47 -0500
committerJunio C Hamano <gitster@pobox.com>2018-11-13 14:22:02 +0900
commit263db403face43927c2eb545a2e6ebb39aae4239 (patch)
treee851206ef0d532f642a0ec5d70105d9f30f427a3 /sha1-name.c
parentb2ac148faecc95243ed8da0b75f63966d828c802 (diff)
downloadgit-263db403face43927c2eb545a2e6ebb39aae4239.tar.gz
rename "alternate_object_database" to "object_directory"
In preparation for unifying the handling of alt odb's and the normal repo object directory, let's use a more neutral name. This patch is purely mechanical, swapping the type name, and converting any variables named "alt" to "odb". There should be no functional change, but it will reduce the noise in subsequent diffs. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1-name.c')
-rw-r--r--sha1-name.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sha1-name.c b/sha1-name.c
index faa60f69e3..2594aa79f8 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -95,8 +95,8 @@ static int match_sha(unsigned, const unsigned char *, const unsigned char *);
static void find_short_object_filename(struct disambiguate_state *ds)
{
int subdir_nr = ds->bin_pfx.hash[0];
- struct alternate_object_database *alt;
- static struct alternate_object_database *fakeent;
+ struct object_directory *odb;
+ static struct object_directory *fakeent;
if (!fakeent) {
/*
@@ -110,24 +110,24 @@ static void find_short_object_filename(struct disambiguate_state *ds)
}
fakeent->next = the_repository->objects->alt_odb_list;
- for (alt = fakeent; alt && !ds->ambiguous; alt = alt->next) {
+ for (odb = fakeent; odb && !ds->ambiguous; odb = odb->next) {
int pos;
- if (!alt->loose_objects_subdir_seen[subdir_nr]) {
- struct strbuf *buf = alt_scratch_buf(alt);
+ if (!odb->loose_objects_subdir_seen[subdir_nr]) {
+ struct strbuf *buf = alt_scratch_buf(odb);
for_each_file_in_obj_subdir(subdir_nr, buf,
append_loose_object,
NULL, NULL,
- &alt->loose_objects_cache);
- alt->loose_objects_subdir_seen[subdir_nr] = 1;
+ &odb->loose_objects_cache);
+ odb->loose_objects_subdir_seen[subdir_nr] = 1;
}
- pos = oid_array_lookup(&alt->loose_objects_cache, &ds->bin_pfx);
+ pos = oid_array_lookup(&odb->loose_objects_cache, &ds->bin_pfx);
if (pos < 0)
pos = -1 - pos;
- while (!ds->ambiguous && pos < alt->loose_objects_cache.nr) {
+ while (!ds->ambiguous && pos < odb->loose_objects_cache.nr) {
const struct object_id *oid;
- oid = alt->loose_objects_cache.oid + pos;
+ oid = odb->loose_objects_cache.oid + pos;
if (!match_sha(ds->len, ds->bin_pfx.hash, oid->hash))
break;
update_candidates(ds, oid);