| -rw-r--r-- | ui-snapshot.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c index 237a75f..b2d95f7 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c @@ -139,8 +139,7 @@ static int make_snapshot(const struct cgit_snapshot_format *format, * pending a 'v' or a 'V' to the remaining snapshot name ("0.7.2" -> * "v0.7.2") gives us something valid. */ -static const char *get_ref_from_filename(const struct cgit_repo *repo, - const char *filename, +static const char *get_ref_from_filename(const char *url, const char *filename, const struct cgit_snapshot_format *format) { const char *reponame; @@ -154,7 +153,7 @@ static const char *get_ref_from_filename(const struct cgit_repo *repo, if (get_oid(snapshot.buf, &oid) == 0) goto out; - reponame = cgit_repobasename(repo->url); + reponame = cgit_repobasename(url); if (starts_with(snapshot.buf, reponame)) { const char *new_start = snapshot.buf; new_start += strlen(reponame); @@ -201,7 +200,7 @@ void cgit_print_snapshot(const char *head, const char *hex, } if (!hex && dwim) { - hex = get_ref_from_filename(ctx.repo, filename, f); + hex = get_ref_from_filename(ctx.repo->url, filename, f); if (hex == NULL) { cgit_print_error_page(404, "Not found", "Not found"); return; |