]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sha1_name.c
sha1_file: add repository argument to prepare_alt_odb
[thirdparty/git.git] / sha1_name.c
index 611c7d24ddee678470ba74cb3c2ca669a778b44a..4325f74e0cbdb2502887b1c80ad18b88c23bba5d 100644 (file)
@@ -10,6 +10,8 @@
 #include "dir.h"
 #include "sha1-array.h"
 #include "packfile.h"
+#include "object-store.h"
+#include "repository.h"
 
 static int get_oid_oneline(const char *, struct object_id *, struct commit_list *);
 
@@ -104,7 +106,7 @@ static void find_short_object_filename(struct disambiguate_state *ds)
                 */
                fakeent = alloc_alt_odb(get_object_directory());
        }
-       fakeent->next = alt_odb_list;
+       fakeent->next = the_repository->objects->alt_odb_list;
 
        for (alt = fakeent; alt && !ds->ambiguous; alt = alt->next) {
                int pos;
@@ -195,7 +197,8 @@ static void find_short_packed_object(struct disambiguate_state *ds)
        struct packed_git *p;
 
        prepare_packed_git();
-       for (p = packed_git; p && !ds->ambiguous; p = p->next)
+       for (p = get_packed_git(the_repository); p && !ds->ambiguous;
+            p = p->next)
                unique_in_pack(p, ds);
 }
 
@@ -351,7 +354,7 @@ static int init_object_disambiguation(const char *name, int len,
 
        ds->len = len;
        ds->hex_pfx[len] = '\0';
-       prepare_alt_odb();
+       prepare_alt_odb(the_repository);
        return 0;
 }
 
@@ -565,7 +568,7 @@ static void find_abbrev_len_packed(struct min_abbrev_data *mad)
        struct packed_git *p;
 
        prepare_packed_git();
-       for (p = packed_git; p; p = p->next)
+       for (p = get_packed_git(the_repository); p; p = p->next)
                find_abbrev_len_for_pack(p, mad);
 }