* Note that it may point to static storage and is only valid until another
* call to sha1_file_name(), etc.
*/
-static int stat_sha1_file(const unsigned char *sha1, struct stat *st,
- const char **path)
+#define stat_sha1_file(r, s, st, p) stat_sha1_file_##r(s, st, p)
+static int stat_sha1_file_the_repository(const unsigned char *sha1,
+ struct stat *st, const char **path)
{
struct alternate_object_database *alt;
static struct strbuf buf = STRBUF_INIT;
if (!oi->typep && !oi->typename && !oi->sizep && !oi->contentp) {
const char *path;
struct stat st;
- if (stat_sha1_file(sha1, &st, &path) < 0)
+ if (stat_sha1_file(the_repository, sha1, &st, &path) < 0)
return -1;
if (oi->disk_sizep)
*oi->disk_sizep = st.st_size;
die("replacement %s not found for %s",
sha1_to_hex(repl), sha1_to_hex(sha1));
- if (!stat_sha1_file(repl, &st, &path))
+ if (!stat_sha1_file(the_repository, repl, &st, &path))
die("loose object %s (stored in %s) is corrupt",
sha1_to_hex(repl), path);