Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-23 20:21:09 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-26 20:05:55 +0300
commit13068bf0a04c4c3cfc177f1aabc61037e319d595 (patch)
tree21c9eb9dec8c6767752c573115ac502f16a3ddf3 /sha1_file.c
parent77f012e876d5845856cb939c6435e839d5f9d027 (diff)
sha1_file: allow prepare_alt_odb to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/sha1_file.c b/sha1_file.c
index d38f5cdb0e..04118f331c 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -673,18 +673,15 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb)
return r;
}
-void prepare_alt_odb_the_repository(void)
+void prepare_alt_odb(struct repository *r)
{
- if (the_repository->objects->alt_odb_tail)
+ if (r->objects->alt_odb_tail)
return;
- the_repository->objects->alt_odb_tail =
- &the_repository->objects->alt_odb_list;
- link_alt_odb_entries(the_repository,
- the_repository->objects->alternate_db,
- PATH_SEP, NULL, 0);
+ r->objects->alt_odb_tail = &r->objects->alt_odb_list;
+ link_alt_odb_entries(r, r->objects->alternate_db, PATH_SEP, NULL, 0);
- read_info_alternates(the_repository, get_object_directory(), 0);
+ read_info_alternates(r, r->objects->objectdir, 0);
}
/* Returns 1 if we have successfully freshened the file, 0 otherwise. */