sha1_file: allow sha1_file_name to handle arbitrary repositories

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2018-03-23 18:21:16 +01:00
committed by Junio C Hamano
parent e977fc7469
commit a68377b5de
2 changed files with 3 additions and 4 deletions

View 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);
}