]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_file.c
sha1_file: add repository argument to prepare_alt_odb
[thirdparty/git.git] / sha1_file.c
index ba4fc9103bb8addfacb211ddbb7bc53c07b1a836..0fac75bd31e5f9d40f26983f1da3022549a6fc74 100644 (file)
@@ -582,7 +582,7 @@ void add_to_alternates_memory(const char *reference)
         * Make sure alternates are initialized, or else our entry may be
         * overwritten when they are.
         */
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
 
        link_alt_odb_entries(the_repository, reference,
                             '\n', NULL, 0);
@@ -668,7 +668,7 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb)
        struct alternate_object_database *ent;
        int r = 0;
 
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
        for (ent = the_repository->objects->alt_odb_list; ent; ent = ent->next) {
                r = fn(ent, cb);
                if (r)
@@ -677,7 +677,7 @@ int foreach_alt_odb(alt_odb_fn fn, void *cb)
        return r;
 }
 
-void prepare_alt_odb(void)
+void prepare_alt_odb_the_repository(void)
 {
        if (the_repository->objects->alt_odb_tail)
                return;
@@ -728,7 +728,7 @@ static int check_and_freshen_local(const unsigned char *sha1, int freshen)
 static int check_and_freshen_nonlocal(const unsigned char *sha1, int freshen)
 {
        struct alternate_object_database *alt;
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
        for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) {
                const char *path = alt_sha1_path(alt, sha1);
                if (check_and_freshen_file(path, freshen))
@@ -887,7 +887,7 @@ static int stat_sha1_file(const unsigned char *sha1, struct stat *st,
        if (!lstat(*path, st))
                return 0;
 
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
        errno = ENOENT;
        for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) {
                *path = alt_sha1_path(alt, sha1);
@@ -918,7 +918,7 @@ static int open_sha1_file(const unsigned char *sha1, const char **path)
                return fd;
        most_interesting_errno = errno;
 
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
        for (alt = the_repository->objects->alt_odb_list; alt; alt = alt->next) {
                *path = alt_sha1_path(alt, sha1);
                fd = git_open(*path);