sha1_file: allow sha1_file_name to handle arbitrary repositories
[gitweb.git] / sha1_file.c
index 74c68ea776fb4a872d49e646c8b915ccb8890d85..aed9a558c5824b540423c3f39c384cf7fe7e4e7e 100644 (file)
@@ -323,9 +323,9 @@ static void fill_sha1_path(struct strbuf *buf, const unsigned char *sha1)
        }
 }
 
-void sha1_file_name_the_repository(struct strbuf *buf, const unsigned char *sha1)
+void sha1_file_name(struct repository *r, struct strbuf *buf, const unsigned char *sha1)
 {
-       strbuf_addstr(buf, get_object_directory());
+       strbuf_addstr(buf, r->objects->objectdir);
        strbuf_addch(buf, '/');
        fill_sha1_path(buf, sha1);
 }