summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bd1b281)
Prepare to allow a custom snapshot prefix.
Signed-off-by: John Keeping <john@keeping.me.uk>
Reviewed-by: Christian Hesse <mail@eworm.de>
* pending a 'v' or a 'V' to the remaining snapshot name ("0.7.2" ->
* "v0.7.2") gives us something valid.
*/
* 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 char *url, const char *filename,
+static const char *get_ref_from_filename(const struct cgit_repo *repo,
+ const char *filename,
const struct cgit_snapshot_format *format)
{
const char *reponame;
const struct cgit_snapshot_format *format)
{
const char *reponame;
if (get_oid(snapshot.buf, &oid) == 0)
goto out;
if (get_oid(snapshot.buf, &oid) == 0)
goto out;
- reponame = cgit_repobasename(url);
+ reponame = cgit_repobasename(repo->url);
if (starts_with(snapshot.buf, reponame)) {
const char *new_start = snapshot.buf;
new_start += strlen(reponame);
if (starts_with(snapshot.buf, reponame)) {
const char *new_start = snapshot.buf;
new_start += strlen(reponame);
- hex = get_ref_from_filename(ctx.repo->url, filename, f);
+ hex = get_ref_from_filename(ctx.repo, filename, f);
if (hex == NULL) {
cgit_print_error_page(404, "Not found", "Not found");
return;
if (hex == NULL) {
cgit_print_error_page(404, "Not found", "Not found");
return;